AnsweredAssumed Answered

FLAG registers and DAI

Question asked by dougcl on Nov 17, 2013
Latest reply on Nov 21, 2013 by MaheshN

Hi folks, just getting started with the 21489, looking at the POST project, specifically, pb_led_test.c sets up the LEDs. I'm not sure what the role of the FLAGs register is in this case.

 

Example:

 

SRU(FLAG6_O,DPI_PB06_I);/* connect Flag6 output to DPI_PB06 input (LED1) */

 

To turn off and on the LED, it is sufficient to use

SRU(HIGH,DPI_PB06_I) and SRU(LOW,DPI_PB06_I) to toggle the LEDs.

 

What is the reason to involve the FLAGs register? Is it to demonstrate the means of changing all the LEDs at once, like this?

sysreg_bit_clr( sysreg_FLAGS, (FLG3|FLG4|FLG5|FLG6|FLG7|FLG8) );

 

Also, is there some relationship between FLAGs and DPI that is not the same as FLAGs and DAI? The reason I ask is that the use of FLAGs to route signals to DAI, for example

SRU(FLAG8_O,DAI_PB16_I);/* connect Flag8 output to DAI_PB16 input (LED7) */

 

doesn't seem to work very well. Constructs like this lead to either more than one adjacent LED lighting, or the LED lighting in spite of this being executed:

sysreg_bit_clr( sysreg_FLAGS, (FLG4|FLG5|FLG6|FLG7|FLG8) );

 

In this case the DPI pins clear just fine (connected to FLG4,5,6) but the DAI pin routed from FLG8 is lit.

 

What is the general reason for involving FLAGs to turn on LEDs, and why do I have trouble using this approach with DAI and not DPI?

Thanks

Doug

 

Perhaps I should mention that I am using CCES.

Outcomes