PDA

View Full Version : serial port interrupt without using hserin



cluster
- 27th September 2011, 00:39
hi

can any one tell me how to use interrupt using serin and serin2?
i know serial interrupt can be setup if using hserin but is it possible to setup interrupt using serin and serin2.
in my application i needed to used 3 serial port for receiving some data. i am using pic18f4550

thanks

HenrikOlsson
- 27th September 2011, 06:13
You'd have to run the serial input to a pin which can trip an external interrupts, like RB0, set it up to the correct polarity and then have the SERIN in your ISR. I've never tried this though so don't take my word for it.

/Henrik.

mister_e
- 27th September 2011, 06:20
Yes this may work, but don't expect reliability if you receive long messages... and I'm pretty sure SERIN/DEBUG/SERIN2 will not work AS-IS as the interrupt on change will screw the start bit...

So I guess you may have decent results with a custom bit-banged routine.

Darrel Taylor
- 27th September 2011, 14:56
Charles Linquis and I did something that might work for you.

http://www.picbasic.co.uk/forum/showthread.php?t=11966&p=79798#post79798