Hi all,

I've been experimenting around with serial io on an 8051 development  
board.  I've run into the following situation.

The board is a Cypress FX2LP.  The Cypress kit comes with Keil trial  
c51 compiler.  The included keil examples for serial IO all use Timer  
1.  Also, the 8051.com tutorials for serial IO/baud rate use Timer 1.   
SDCCs examples (at least clock.c for the mcs51) also use timer 1 for  
the baud rate.

My problem is that all these examples work correctly with Timer 1 when  
I compile them with Keil C51.  When I use sdcc however, the baud rate  
does not work.  The 8051 won't receive any bytes (RI is never set) and  
when transmitting, the client side just gets 0 bits (I used gtkterm to  
monitor the incoming hex bytes.)

Because the fx2lp has an additional timer, I tried that out with sdcc  
and found that it does work.  I compiled the keil examples as well as  
the sdcc examples with the baud rate being generated from T2 instead  
of T1 and the programs begin to function correctly.

Does anyone know of a reason why T1 wouldn't work when I compile with  
sdcc?

Using sdcc 2.8.0 on Fedora core 8.  I'd be happy to provide additional  
code if anyone is interested.  I have this exact problem simply using  
the clock example in <sdcc>/device/examples/mcs51/clock though.


Thanks
Dennis


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to