Searching \ for 'Re[2]: [EE] Very odd problem with RS232...' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/io/serials.htm?key=rs232
Search entire site for: '[EE] Very odd problem with RS232...'.

Truncated match.
PICList Thread
'Re[2]: [EE] Very odd problem with RS232...'
2007\01\13@010114 by Dumitru Stama

flavicon
face

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: spam_OUTpiclist-bouncesTakeThisOuTspammit.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> --

2007\01\13@022349 by Vasile Surducan

face picon face
Dumitru, you're very good documented.

http://www.surducan.netfirms.com/RS232.html
Vasile

On 1/12/07, Dumitru Stama <.....listKILLspamspam@spam@mirosat.com> wrote:
{Quote hidden}

>

2007\01\13@095850 by olin piclist

face picon face
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 :

Even better is to let the assembler do the computation at assembly time from
more human-relevant constants in your source code.  This is what my
UART_BAUD macro in STD.INS.ASPIC at http://www.embedinc.com/pic does.  You
previously define the oscillator frequency with FREQ_OSC, you pass the
desired baud rate to the macro, and it computes the UART setup for you
automatically.  It even gives you a warning when the error gets to 1/4 bit
time at the last bit, and a error if it gets to 1/2 bit time.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

More... (looser matching)
- Last day of these posts
- In 2007 , 2008 only
- Today
- New search...