cancel
Showing results for 
Search instead for 
Did you mean: 

SCI initialization in ST92163

kbrown
Associate II
Posted on November 26, 2002 at 19:23

SCI initialization in ST92163

4 REPLIES 4
kbrown
Associate II
Posted on May 17, 2011 at 11:32

The ST92163 documentation says that ''all'' the SCI registers should be initialized between writing the high and low bytes of the baud rate generator register, and that ''on the fly'' modifications can cause corruption.

But in normal operation, you at the very least need to modify the S_ISR register, and the S_IMR register if you want to enable/disable SCI interrupts on the fly. So, does that mean that the warning about ''on the fly'' modifications does not apply to these registers?

Are there any other registers that the warning about ''on the fly'' modifications does not apply to? In particular, I'm interested in whether it is possible to modify the S_IDPR register on the fly.
Posted on May 17, 2011 at 11:32

The ''on the fly'' modification note concerns the SCI-M control registers which would then be the SICR, SOCR, BRGHR, BRGLR, CHCR and CCR registers.

So, on fly access to all other registers such as the IMR, ISR, RXBR, TXBR, ACR and IDPR registers is then allowed and does not require any access to the Baud Rate Generator. This is good because the user does not want to re-initialize and re-start the SCI-M peripheral after each transmission, reception or SCI interrupt.

By the way, you will find 4 SCI-M source examples in the user guide software library (transmission, reception, examples with or without DMA). These programs target the ST92F120 or the ST90158 but since that's the exact same SCI-M periphal as the ST92163's one, you should be all set.

Jojo

Posted on May 17, 2011 at 11:32

You can do it, but be carefull. Modifying your interrupt vector with your interrupt enabled or modifying your DMA pointer while the DMA is in process may be full of surprise

However, you can certainly modify these registers outside your Baud Rate High Register / Low Register subroutine

Jojo

kbrown
Associate II
Posted on May 17, 2011 at 11:32

Cool. There were a number of registers Jojo did not mention explicitly: S_IVR, RDCPR, RDAPR, TDCPR, and TDAPR. I would expect that the 4 DMA related registers should be writeable at any time, because as JoJo says, you don't want to reinitialize the SCI-M on every transmission. But how about S_IVR? Can S_IVR be modified on the fly?

(I will also check the examples in the library - maybe the answer is in there, but maybe not).