News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

18F26K22 to 18F14K22

Started by joesaliba, Jan 29, 2023, 08:40 AM

Previous topic - Next topic

joesaliba

Hi,

I have this code running nicely with a 18F26K22 using the Buffered HSerin, and am trying to migrate the code to an 18F14K22 as I do not need all those pins due to board size.

Code is running at 8MHz. Flashing a simple LED looks that everything is working great, however, I cannot transmit or receive data through the hardware USART.

I can see that I am sending data but it is not correct, at least, the receiver is not receiving what it should receive.

Am I missing some settings in the 18F14K22?

Is anyone using the 18F14K22 with the Buffered HSerin?

Regards

Joe

joesaliba

Ok, looks I solved the problem, (why it happens after I post on forum??)

I had RCSTA and TXSTA manually set and it did not work. So I commented out these two line and left everything in Positron hands.

It worked immediately, suggesting that I did set something wrong.

I printed out what RCSTA and TXSTA and found that the only thing I had different was the TXSTA.2. I had set TXSTA.2, meaning High speed Baud Rate, which obviously was not the case.

Now everything is working ok, at least I hope.

Regards

Joe