PDA

View Full Version : Autodetect serial communication?



mradde
- 25th February 2009, 02:04
How to get the PIC autodetect if an serial RS-232 cable is connected?
If the serial RS-232 cabel is not connected the PIC should ignore the serial port commands, or someting like that. Any ideas?

mister_e
- 25th February 2009, 04:16
Handle your serial communication with interrupt.

Are you building the PC application? If so that make things lot easier then.

Knowing a little much about your hardware will help.

mradde
- 26th February 2009, 09:55
It is a pic18f4550.
I think i am on the right way, USART interrupt. I will look this up more specific.

mradde
- 28th February 2009, 00:27
USART interrupt seams to be good. But as far i can understand HSEROUT/HSERIN dont accpet inverted mode. And to get correct data out of HSEROUT/IN i need RS-232 controller like MAX232 ic right?

So best solution for me would be a inverted SEROUT/SERIN interrupt, but is that possible?
I have played little with "Darrel Taylor instant interrupts" and interrupts seams to be a very useful in many situations!