UART2_INIT initialisation issue 18F27K42
UART2_INIT initialisation issue 18F27K42
I found the UART2_INIT to set the TRISB2_bit , i do not see any reason for this so suppose it to be by accident
Au royaume des aveugles, les borgnes sont rois.
Re: UART2_INIT initialisation issue 18F27K42
it turns out this function starts calling __Lib_UART_Remappable_K42_83_UART2_MapDefaultPins , as far as i see in the datasheet there is a default RX1 and RX2 pin however the TX1 and TX2 both need remapping, the setting of RB2 as input makes no sense here, what btw would be the Default pins to which this function would map the RX and TX pins?
Au royaume des aveugles, les borgnes sont rois.
Re: UART2_INIT initialisation issue 18F27K42
Hi,
Yes, UART2_Init is set to RB5(Tx) and RB2(Rx) pins by default, I will see with the developers about the choice of pins.
On the other hand, you can remap the UART to pins of our choice using the PPS library (using the datasheet for reference).
Regards,
Filip.
Yes, UART2_Init is set to RB5(Tx) and RB2(Rx) pins by default, I will see with the developers about the choice of pins.
On the other hand, you can remap the UART to pins of our choice using the PPS library (using the datasheet for reference).
Regards,
Filip.
Re: UART2_INIT initialisation issue 18F27K42
Filip,
thanks for the reply , i had figured out these pin assignments in between ( took me a while as i used them for something else) , do not think this is a convenient solution though, there is a default RX2 on RB7 according to the datasheet, to me it would seem logical to leave that at least in place and in analogy with UART1 RB6 would be the most logical default TX2, I failed to do so until now as there must be issues with the devicefile, i cannot find _TX2_CK2 or it's equivalent yet.
thanks for the reply , i had figured out these pin assignments in between ( took me a while as i used them for something else) , do not think this is a convenient solution though, there is a default RX2 on RB7 according to the datasheet, to me it would seem logical to leave that at least in place and in analogy with UART1 RB6 would be the most logical default TX2, I failed to do so until now as there must be issues with the devicefile, i cannot find _TX2_CK2 or it's equivalent yet.
Au royaume des aveugles, les borgnes sont rois.
Re: UART2_INIT initialisation issue 18F27K42
ok, worked out the direct PPS configuration, by using the Uartx_remappable_init and writing directly into the appropriate PPS registers it all works ok , i noticed this is the way to go as the PPS library wastes a horrible amount of ROM ( not far from 1K5 !)
Perhaps you should focus on explaining how to configure PPS in general directly ( possibly provide some predefined constants) and forget about these memory-wasting libraries.
Perhaps you should focus on explaining how to configure PPS in general directly ( possibly provide some predefined constants) and forget about these memory-wasting libraries.
Au royaume des aveugles, les borgnes sont rois.