Hi,
with my friends we are doing school project. One part of this project requires UART initialization. This is first time we are using such processor(CF5282), until now we were only using M68HC11. Problem is that we can't get UART to work at all. I think we set correctly everything, but on PC we don't receive anything. Our setting are 9600bps, 8bits per char, 1 stop bit, no parity. Can somebody tell us what did we wrong?
Thanks in advance, Crt Gorup
Code:.EQU TERM_BUF, 0x4000020C /* buffer register */.EQU TERM_CMD, 0x40000208 /* command register */.EQU TERM_IRQ, 0x40000214 /* interrupt enable/disable register */.EQU TERM_CLK, 0x40000204 /* clock select register */.EQU TERM_UBG1N, 0x40000218 /* clock divider upper register */.EQU TERM_UBG2N, 0x4000021C /* clock divider lower register */.EQU TERM_UMR1, 0x40000200 /* parity, bits per char */.EQU TERM_UMR2, 0x40000204 /* stop bit length, RTS */.EQU TERM_ENB, 0x01 /* enable interrupt */.EQU TERM_DIS, 0x00 /* disable interrupt */ MOVE.B #0x3A, %D0 /* reset transmiter, disable transmiter and */ MOVE.B %D0, TERM_CMD /* disable reciever */ MOVE.B #0x6, %D0 /* enable reciever */ MOVE.B %D0, TERM_CMD MOVE.B #0x00, %D0 /* set clock divider upper register */ MOVE.B %D0, TERM_UBG1N MOVE.B #0xD6, %D0 /* set clock lower upper register */ MOVE.B %D0, TERM_UBG2N MOVE.B #0xDD, %D0 /* select system prescaled clock */ MOVE.B %D0, TERM_CLK MOVE.B #0x13, %D0 /* parity none, 8 bits per character */ MOVE.B %D0, TERM_UMR1 MOVE.B #0x07, %D0 /* stop bit length = 1.0, RTS disabled */ MOVE.B %D0, TERM_UMR2
/* sending character */ MOVE.B #TERM_ENB,%D0 /* enable interrupts */ MOVE.B %D0,TERM_IRQ MOVE.B #STRING, %D0 /* put char into buffer */ MOVE.B %D0, TERM_BUF MOVE.B #TERM_DIS,%D0 /* disable interrupts */ MOVE.B %D0,TERM_IRQ