Before set Remappable UART on my pic 16(L)F18346 i tried to give a look to MIkroe forum and i found one paulfjujo Post about problem to mab right UART pins; unfortunatelli he used another MCU 16(K)F1619, he found a bug in PPS mapping mikroC library
For my Case is different i have difficult to mag my pic UART, below ther's datasheet tables.
I attached my configuration PPS (Peripherial pin select)
What is to wrong?
Thank you to you help.
Leonardo.
Code: Select all
////////////////////////////// UART TEST ///////////////////
//
// PIN OUT:
// RC5 --> TX
// RC4 --> RX
//
//
//////////////////////////////////////////////////////////////
#define CLS 12
#define CR 13
#define LF 10
#define TAB 9
void CRLF1()
{
UART1_Remappable_Write(CR);
UART1_Remappable_Write(LF);
}
void UART1_Write_CText(const char *txt)
{
while (*txt)
UART1_Remappable_Write(*txt++);
Delay_us(5);
}
void main() {
// here MCU init
// set oscon reg (set clock it work fine!!! )
// Pin direction, port reset, switch off comparator
// USART1 RX, TX
// ---------- Peripheral PIN and EUSART configuration ----------------------
//PPS_Mapping_NoLock(_RC5, _OUTPUT, 18); // .<--------------------------------correctif !
PPS_Mapping_NoLock(_RC5, _OUTPUT, 14); //10100(TX/CK) pag.163 Datasheet TX/CK
PPS_Mapping_NoLock(_RC4, _INPUT, _RXPPS);
UART1_Remappable_Init(9600); //19200
UART1_Write_CText (" Test : \r\n");
}