What is the right way to map pins for PWM and UART when using according mikroC PRO for PIC32 library functions? For example, I am using a PIC32MX250F128B microcontroller and here I have a simple code for just trying PWM with this MCU:
Code: Select all
unsigned int pwm_period;
void init_MCU()
{
JTAGEN_bit = 0;
ANSELA = 0;
ANSELB = 0;
TRISA = 0;
TRISB = 0;
LATA = 0;
LATB = 0;
Unlock_IOLOCK();
PPS_Mapping( _RPB3, _OUTPUT, _OC1 );
Lock_IOLOCK();
}
void main() {
init_MCU();
pwm_period = PWM_Init(10000, 1, 1, 2);
PWM_Start(1);
PWM_Set_Duty(pwm_period/2, 1);
}
And the same thing with UART. Before I use UARTx_Init() and UARTx_Write() or UARTx_Read(), how do I determine which pins to use as TX and RX?
Thanks for help!