Re: how to drive serial port0 with timer1
Bryan Armstrong <bryan.armstrong-6tN4nzCoH/[email protected]>
| Newsgroups | gmane.comp.hardware.microcontrollers.tini |
|---|---|
| Message-ID | <[email protected]> |
? ? wrote: > OSCILLATOR_FREQ equ 18432000 > ... > mov scon0, #5Ah ;0101 1010 > orl pcon, #80h > orl ckcon, #10h ; Set T1M = 1 > mov th1, #0xFF ; Set timer reload high byte > orl tmod, #20h ; Set timer1 Mode 2, 8 bit auto-reload > anl t2con, #0xcf ; Enable timer 1 for serial port > setb tr1 ; Set timer 1 to run*/ > ; Make sure that we can output to the serial port > setb ti > > while the printf in main function didnot work. Could you please offer me > the right way? >From a quick calculation, it looks like this sets the baud rate to 288000bps. Is this what you are expecting? If you set TH1 to 251 (256 - 5), you can get 57600bps which is a much more common baud rate for PCs, etc. -- -- Bryan Armstrong bryan.armstrong-6tN4nzCoH/[email protected] _______________________________________________ TINI mailing list TINI-6tN4nzCoH/[email protected] To UNSUBSCRIBE, edit your profile, or see list archives: http://lists.dalsemi.com/mailman/listinfo/tini