PDA

View Full Version : Microcode: How to setup SERIN for 115200 baud rate?



morenoingrato
- 22nd February 2013, 01:59
I need to do that with a project. The datasheet confirms my Pic (16F628A) can handle that baud rate, but SERIN locks me with 300, 1200, 2400 and 9600 bits per second.
What can I do to make it work with the rates I need?

prstein
- 22nd February 2013, 05:13
The baud rates listed in the datasheet relate to using the chip's internal USART. To access this you would need to use the HSERIN command, use the specific USART RX pin, and likely need a level shifter. However there are great benefits to using the hardware serial port, including use of interrupts and a small (two byte) buffer.

SERIN (and SERIN2 and DEBUGIN) are software-generated, essentially "bit banging" routines. They absolutely have their uses, and can be assigned to almost any free pin, but you will not be able to get that sort of speed out of them.

Best Regards,
Paul