PDA

View Full Version : SERIN to HSERIN and Inverted Logic



Stubbie
- 17th June 2008, 03:48
Hello All--

I've been working on a program for the 16F627 that used one of the I/O pins with an inverted logic baud rate to successfully receive data from my computer through RS-232.

I would now like to use hardware USART pin on this PIC due to buffering and whatnot. I know the HSERIN doesn't have an inverted option, so I've tried inverting the bytes that I send down the serial line on the computer hoping that the PIC would be able to pick them up. I've not had success with this and I believe its because my start and stop bits are not sent with inverted logic.

Does this reasoning path seem logical? If so, how can I fix this problem completely from a software side, I'd like to avoid a MAX232 or the like if at all possible.

Thanks

skimask
- 17th June 2008, 13:50
Does this reasoning path seem logical? If so, how can I fix this problem completely from a software side, I'd like to avoid a MAX232 or the like if at all possible.
I (and this is just me) think you're better off just getting a MAX232 or DS275 (?).
That being said, you could use just a plain ol' transistor (or MOSFET) to invert your signal coming out of the PIC.

Stubbie
- 20th June 2008, 03:28
That sounds like a resonable solution, I'm learning this as I go, do you have a good example?

I've found this: http://www.physics.udel.edu/~watson/ALLSTEL99/sld026.htm Hooked it up, and had no success.

Thanks a lot

Stubbie
- 20th June 2008, 04:14
Ok, I got it working with an inverter, but thats a long term solution due to its size, so an example with a MOSFET would be great stiil. At least it appears that the programming on both ends is valid.

mackrackit
- 20th June 2008, 04:59
The link you posted has a MOSFET example?

But what is wrong with using a MAX232 or similar? This is what they are made for.

Stubbie
- 22nd June 2008, 04:09
Size and cost.

Got it working with a transistor an a resistor:

http://www.scienceprog.com/alternatives-of-max232-in-low-budget-projects/