On 2010-7-16 06:04, Daniel Drotos wrote:
On Fri, 16 Jul 2010, 谢继雷 wrote:
and I want to know if there is some options to control the simulated
serial line's baud to S51 simulator.
Obviously there is no such option.
Baud rate is controlled by SFRs of timer and uart. Simulator counts
ticks and when all necessary bits are "received" it reads in one byte
from the input file and makes availabe as content of UART's data
register.
s51 -tC52 -S in=testdata.in,out=testdata.out commtest_m.ihx
In this example, the serial input from file testdata.in is sent to S51
too fast, and many frames are lost. When the serial input from /dev/tty
(user keyboard) does work well.
You should check if your main is fast enough to process continous
data, or check sync of main and ISRs.
You can place breakpoint at serial ISR and check if it happens at
expected time (check receive only case without sending).
Or provide me values of SRFs (or source code of a stripped down
example), and I'll try to check if there is a simulator bug.
Daniel
checkout for this,
svn://svn.bodz.net/usnap/miadev/trunk
(username&password: miadev, with rw permission.)
The directory structure:
arch/cos51: COS51 is my C framework for 51 chip and peripherals.
arch/cos51/dk/hc6800.h: resource definition for my DK board
(You may create new one to match your own DK board. )
test/cos51: unit test files
The referred example is test/cos51/comm1test.c and comm2test.c, the two
corresponding two Timer 1 driven serial port and Timer 2 driven serial
port.
Both tests are fine if thru TTY, but failed if by plain files.
To build the example, first make arch/cos51, then make test/cos51.
I'm building under Cygwin port of sdcc/ucsim, and I didn't have tested
on any *NIX yet.
Lenik
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user