This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TSC channels vs. steps & registers

I'm reading through the TRM for the ARM335x as I am using a BeagleBone Black for a new product line and need to use the PRUs and the TSC_ADC.

I understand that the ADC is an 8 channel device.  The TRM includes 16 step configuration registers.  I don't understand why there is a difference.  It's a newbie question for sure but I'd appreciate some enlightenment and if the answer is obvious, please go gently.  I am an old dog, refreshing on old tricks, learning new ones, and enjoying most of the treats that come along with them.

Thanks, 

WC

  • The steps are for specifying which channels should be sampled, in what order, and with how much delay between samples.

  • I'm being a dunce here probably.  I see in the TRM (SPRUH73Q–October 2011–Revised December 2019, starting on page 1842) a table with registers listed such as STEPCONFIG1 and STEPDELAY1 up to STEPCONFIG16 and STEPDELAY16 with every register between 1 and 16 listed.  They all have different offsets.  So, with only 8 channels of A/D, I was expecting there to just be registers STEPCONFIG1 -> STEPCONFIG8.   How do these map to the actual A/D channels?  Is STEPCONFIG1 channel 0?  If so, then what does STEPCONFIG8 map to and STEPCONFIG9, and so on?  

    Thanks for your help!

  • It is configurable.  Please see bits 22:19 in the STEPCONFIGx register.  You pick the channel.  If you want to sequence through the channels in order you would configure

    STEPCONFIG1[22:19] = 0

    STEPCONFIG2[22:19] = 1

    STEPCONFIG3[22:19] = 2

    STEPCONFIG4[22:19] = 3

    STEPCONFIG5[22:19] = 4

    STEPCONFIG6[22:19] = 5

    STEPCONFIG7[22:19] = 6

    STEPCONFIG8[22:19] = 7

    The intent is that you have flexibility to specify any order you want.  For example in the Linux touchscreen driver we have 5 steps that sample x and 5 steps that sample y.  In the corresponding ISR we discard the min/max values for each coordinate and then average the remainder.  In that example we used 10 steps for just 2 of the channels.  There doesn't have to be a one to one correspondence.

    Best regards,
    Brad

  • Ok, I'm getting it I think, but slowly.  Let me see if I do by offering an example of my own.

    So, I see now that STEPENABLE lets me enable the steps that I want to be executed.  (I missed that concept.)

    So if I had an application that had a sensor A that needs to be read every 10ms and sensor B that only needs to be read every 10 seconds, I could wire channel 1 to sensor A and assign it to step 1 and wire channel 2 to sensor B and assign it to step 2. 

    Then at startup, when I want to read both sensors, I enable steps 1 and 2 but not 3-16.  This saves time on the read as 3-16 aren't needed so I don't read them.  Then after the initial read when I don't need to read sensor B until a minute passes, I can change STEPENABLE so only step 1 is enabled and execute a read every 10 ms.  Only sensor A would be read.  Then at 10 seconds, I change STEPENABLE so steps 1 & 2 are enabled and when read is triggered, sensors A and B are read. 

    BTW - I don't have a real-world application like this but I guess someday I could.

  • I think you've got it.

  • Well, just one more question though.  What does 22:19 refer to in your first reply?  Those bits are reserved aren't they?

  • Thank you!  Excellent support!