Dumitru, you're very good documented. http://www.surducan.netfirms.com/RS232.html Vasile On 1/12/07, Dumitru Stama wrote: > > I have been using rs232 without any handshake but calculations of > spbrg were my first mistake. I made a simple php calculator and this > is what i got for your 13.5MHz frequency : > > The desired frequency is : 13.5000 MHz > The desired baudrate is : 9600 bps > -------------------------------------------------------------------------------- > BRGH = 0 - Low Speed > The calculated value for spbrg is : 20.973 > The value you will use for spbrg is : 21 > The calculated baudrate for this value is : 9588 bps > The error is : -0.13% > > BRGH = 1 - High Speed > The calculated value for spbrg is : 86.891 > The value you will use for spbrg is : 87 > The calculated baudrate for this value is : 9588 bps > The error is : -0.13% > > The error is very small and you will be able to use 9600 with BRGH > being both high or low. Try (as already suggested) without a handshake > and see if it works. After this verify you connected CTS and RTS as > they should be connected. > > wikipedia content below: > http://en.wikibooks.org/wiki/Serial_Programming:MAX232_Driver_Receiver > > The levels should be : > RS-232 TTL Logic > ----------------------------------------------- > -15V ... -3V <-> +2V ... +5V <-> high > +3V ... +15V <-> 0V ... +0.8V <-> low > > The MAX232(A) has two receivers (converts from RS-232 to TTL voltage > levels) and two drivers (converts from TTL logic to RS-232 voltage > levels). This means only two of the RS-232 signals can be converted > in each direction. The old MC1488/1498 combo provided four drivers > and receivers. > Typically a pair of a driver/receiver of the MAX232 is used for > TX and RX > and the second one for > CTS and RTS. > There are not enough drivers/receivers in the MAX232 to also connect > the DTR, DSR, and DCD signals. Usually these signals can be omitted > when e.g. communicating with a PC's serial interface. If the DTE > really requires these signals either a second MAX232 is needed, or > some other IC from the MAX232 family can be used (if it can be found > in consumer electronic shops at all). > > > PL> Thank you for your replies. > > PL> I'm using Sipex SP232ACT. > > PL> I'm using crystal oscillator. It might be problem with oscillator. I wanted to have PIC running at 40MHz on my board, but I didn't read the datasheet carefully ( yes, I know :-/ ) and instead of > PL> putting 10Mhz oscillator and using PLL I put 40MHz oscillator on the board. It is actually running at 13,3 Mhz now. > > PL> Do you think that it might be the problem? > > PL> I'll try lowering the baud rate anyway. > > PL> Sam > > > > > PL> ________________________________ > > PL> From: piclist-bounces@mit.edu on behalf of Jinx > PL> Sent: Fri 1/12/2007 11:00 PM > PL> To: Microcontroller discussion list - Public. > PL> Subject: Re: [EE] Very odd problem with RS232... > > > > > >> You may be getting out of sync with the PIC and the PC if the > >> frequency is off by more than a few percent. Try lowering the > >> baud rate on both the PC And your PIC board, and see if that > >> makes any difference > > PL> Lowering the baud rate will just make errors take longer to happen. > PL> If it is a timing problem, the PIC clock needs to be changed to match > PL> the baud rate from the PC > > PL> Sam, are you going through an RS232 i/f (eg MAX232) ? > > PL> -- > PL> http://www.piclist.com PIC/SX FAQ & list archive > PL> View/change your membership options at > PL> http://mailman.mit.edu/mailman/listinfo/piclist > > PL> . > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist