I figure I should announce that I did fix the problem. The problem was that I was trying to just ! the bit and be happy. However, this doesn't seem to work bitwise or logically! So I did this (Reader's digest condensed version): #define RXNOTINV //rx bit is not inverted #ifdef RXNOTINV #ifdef RXNOTINV for(;;) { while(RXD == 0) continue; //delay 1/2 a bit if(RXD == 0) continue; //get a byte of data //delay to start of stopbit return ~c } #else for(;;) { while(RXD == 1) continue; //delay 1/2 a bit if(RXD == 1) continue; //get a byte of data //delay to start of stopbit return c } #endif Thanks, Craig > -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Dennis Plunkett > Sent: May 5, 1999 10:14 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: Serial interface problem > > > I think that the problem is in the code itself the function ! is a logical > NOT and not bitwise. > If you need to do bitwize then: - > > > void main (void) > > void > main (void) > { > unsigend char i; > volatile unsigned char PORTVAL; > > i =~PORTVAL; //bits now inverted > } > > Hope this helps, I am assuming that you're using C > > > Dennis > > > > > At 22:10 5/05/99 -0500, you wrote: > >It's not clear if you mean the PIC doesnt work, or if your code no longer > does. > >Assuming the latter, I think you'll find that you need to invert > your bits. > >i.e. > >the logic states are reversed without the max232. > > > >Paul > > > >At 06:02 PM 5/5/99 -0600, you wrote: > >>I am puzzled why when I try to interface the > >>transmit data line from an rs232 interface to > >>a pic through a 10k resistor to RA1 why it > >>ceases to operate. On a scope, the levels are > >>a nice 5-0. > >> > >>Works fine with a max232. The only changes > >>I've made are to replace the max232 chip > >>with a 10k, and change my Rxdata define from > >>RA1 to !RA1. > >> > >>I'm sure someone else has ran into this one. > >> > >>Craig > > > >Paul Davis > >Sr. Systems Engineer > >OEM, Carrier Sales, Healthcare > >pdavis@nbase-xyplex.com > >www.nbase-xyplex.com > >184 Shuman Blvd., Suite 200 > >Naperville, IL. 60563 > >Phone: 630-717-2960 x 3072 > >FAX: 630-357-4237 > > > > >