I have an Alfat USB board connected to a system using a PIC with a 20MHz xtal.
I have been using I2C to communicate with the board. This is proving a bit slow for what I want. So I decided I would use the usart instead.
The problem is that my PIC can’t handle 115200 baud with a 20MHz Xtal - it would be difficult for me to run it any faster because of the application.
So I thought - no problem, I’ll use I2C to change the Baud rate for the Alfat board, then pull the reset pin low, reconfigure the interface pins and then restart the board. Then I would be able to communicate at a slower baud rate.
Seems good in theory but as soon as I change the baud rate (and get an acknowledgement from the board) I am no longer able to communicate with either I2c or the usart.
Can you offer any advice? I don’t want to have to configure the Alfat board ‘off board’ if I can help it.
Can you change the crystal on the PIC? I have often used even small PIC’s at 115200 baud, but you usually need to use the correct crystal. Something like 18.xxx or 11.059 Mhz or something like that. A faster crystal does not necessarily mean higher baud rate. The data sheets of the PIC usually have a table that shows exactly the ideal crystal to use.
how fast is it if you toggle a IO pin per seconds on your PIC?
if you are going to change baudrate from 9600<= baudrate <=115200, i am not sure which faster is, between i2C and UART.
As I remember, at 400KHz, I2C can reach up to 27-28KB/s while uart 115200 was about 10KB/s for writing