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.

What Timer and HWI interrupt number is used for the CLOCK module?

Other Parts Discussed in Thread: SYSBIOS

SYSBIOS = 6.34.2.18

DSP = C6748

 

If you use the CLOCK module (which I bet 99% of all SYSBIOS project use), the default Time Base selection is:  "Use Timer to automatically call Clock_tick()".  Right below that, is the Timer Control section.  Setting the Tick period is straight forward, but after that I have questions.

1.  Timer ID can be set to ANY, 0, 1, 2, 3, 4, 5, 6, 7.  If you leave it at the default ANY, what timer ID does is choose?

2.  The C6748 has (4) 64bit timers, that can be configured into (8) 32bit timers.  Because of the selection options above, I assume SYSBIOS is only using a 32bit timer.  I've searched through the SYSBIOS users guide, but can't find out if the CLOCK module uses a 32bit or 64bit timer.  Please confirm:  32bit or 64bit?

3.  How do the Timer ID's map to the C6748 timers?  Does  0 = Timer64P0 lower 32bits?  Does 7 = Timer64P3 upper 32bits?

4.  Assuming the Time Base has been set to "Use Timer", that implies a HWI is created.  What is the name of the HWI created, what HWI priority (4-15) is it set to, and what masking option is it using (ALL, SELF, etc).

5.  I created a small example SYSBIOS project (using the typical settings).  It created a CLOCK tab, and "Use Timer" was selected as the default.  However when I open app.cfg, and looked in the outline, there is no TIMER module loaded.  I do believe the CLOCK module is using one of the C6748 Timers, yet I'm confused as to why app.cfg doesn't include the TIMER module.

Thanks, Dean

  • Dean,

    #1.  The lowest id timer available.

    #2.  32-bits

    #3.  For C6748, you only have 4 timers...id 0, 1,2, 3 (If 4, 5, 6, 7 are available that is a bug).  After selecting the Timer, then you can also select which half.  The default is the lower half.

    #4. It really depends which Timer is being used.  If you look at the table below at the intNum field this is the default for that Timer.  So lower half Timer0 defaults to 14 and upper half Timer0 defaults to 4...same with the rest of the Timers.


                        {
                            name: "Timer0",
                            baseAddr: 0x01c20000,
                            intNum:  [ 14, 4],
                            eventId: [ 4, 64],
                            intFreq: {
                                lo: 24000000,
                                hi: 0,
                            },
                        },
                        {
                            name: "Timer1",
                            baseAddr: 0x01c21000,
                            intNum:  [ 15, 5],
                            eventId: [ 40, 48],
                            intFreq: {
                                lo: 24000000,
                                hi: 0,
                            },
                        },
                        {
                            name: "Timer2",
                            baseAddr: 0x01f0c000,
                            intNum:  [ 6, 6],
                            eventId: [ 25, 25],
                            intFreq: {
                                lo: 150000000,
                                hi: 0,
                            },
                        },
                        {
                            name: "Timer3",
                            baseAddr: 0x01f0d000,
                            intNum:  [ 7, 7],
                            eventId: [ 86, 86],
                            intFreq: {

    #5.  That is simply a configuration parameter of the Clock module.  To  make the Timer show you would have to go to the Timer and use it.

    Judah

  • #3.  For C6748, you only have 4 timers...id 0, 1,2, 3 (If 4, 5, 6, 7 are available that is a bug).  After selecting the Timer, then you can also select which half.  The default is the lower half.

    I agree that the C6748 has 4 timers, but since they are all 64bit timers, and you confirmed that SYSBIOS is only using 32bits, shouldn't that allow up to 8 "timers" to select from?  I created a small test project, with the DSP set to C6748.  When I go to the the CLOCK tab in app.cfg, the Timer ID drop down menu allows 0 through 8.  Is this correct or a bug?

    You said if I select the Timer ID, then I should also be able to select lower or upper half.  On the CLOCK tab when I change Timer ID from ANY to 0, I don't see any new selection that pops up for lower or upper.  I'm a little lost following your directions, please clarify.

     

    #4. It really depends which Timer is being used.  If you look at the table below at the intNum field this is the default for that Timer.  So lower half Timer0 defaults to 14 and upper half Timer0 defaults to 4...same with the rest of the Timers.

    I'd love to know where you got that table from.  At any rate, it does appear to spell out what HWI interrupt priority is used for each timer.  However, you still haven't answered what masking option(ALL, SELF, BITMASK, etc) the HWI is using.  Please clarify.

     

    #5.  That is simply a configuration parameter of the Clock module.  To  make the Timer show you would have to go to the Timer and use it.

    SYSBIOS simply doesn't make sense to me (especially coming from DSPBIOS).  It tries and hide too many things, isn't consistent on where changes should be made, etc.  Does it really make sense when you use the CLOCK module, and you select it to user a TIMER, the following information is "hidden"?  You don't know what Timer is being used.  You don't know what maskable HWI vector is being used.  You don't know the masking setting for the HWI.  Even if you include the TIMER tab, this "hidden" timer that SYSBIOS is using, isn't displayed.  When you go to the HWI tab, this "hidden" TIMER HWI vector isn't displayed.  Besides posting in this forum, is there any other place to find out this information?

    Thanks, Dean

  • Dean

    #3.  I see the discrepancy now.  You are trying to create a Timer from (ti.sysbios.hal.Timer).  This does not show you the "half" that I am talking about.  If you create it from the "device specific timer", you would see which "half" you are creating it from.  As far as the Timer id and drop down, Although it gives you a possibility of 8 in the hal Timer and 16 in the device specific timer, this is because there are some devices that do support 16 timers.  In your case, the device that you have only supports 4 timers so only timers 0, 1, 2, 3 would work.  This is a short coming of the gui interface.  So what I said previously still stands.  Use only Timer id 0-3, You can select which half.

    #4.  The table is taken from the ti/sysbios/timers/Timer64.xs file.   You can also find in the <BIOS INSTALL>\docs\cdoc\ti\sysbios\timers\timer64\doc-files\TimerTable.html the timer IDs.  The HWI always defaults to SELF

    #5.  Yes, its different from DSPBIOS.  There are some things which are better than DSPBIOS and others which are not up to par.  I will take some of your comment back to the SYSBIOS team.   cdoc does give some information...like default values for a config parameter but not as detailed as you would like.  (does not show which default  Hwi int is used for which Timer)

    Judah

  • Judah, I appreciate your help so far.  However, I don't think we are on the same page on a couple of points.

    #3.  My original question was how the Timer ID's map to C6748 timers using the CLOCK module.  Nothing to do with the TIMER module.  The CLOCK module by default has the Time Base set to "Use Timer".  Right below that, on the same CLOCK module tab, is the Timer ID selection.  Please re-read my comments for #3 in the above posts.  I believe the Timer ID selection (on the CLOCK module) works like this.  0 = TIMER0 lower, 1 = TIMER0 upper, 2 = TIMER1 lower, 3 = TIMER1 upper, 4 = TIMER2 lower, 5 = TIMER2 upper, 6 = TIMER3 lower, and 7 = TIMER3 upper.  Again, this assume the C6748.  Please confirm.

    Here is my understanding so far.

    The "typical" SYSBIOS project has a CLOCK module.  By default, the CLOCK module uses a TIMER to call Clock_tick().  Which TIMER SYSBIOS selects is determined by the Timer ID, and by default this is set to ANY.  You have clarified that ANY = lower timer available.  The "typical" SYSBIOS project doesn't include the TIMER module (doesn't show up in the outline).  However, it appears SYSBIOS is using the TIMER module in the background.  At any rate, because I haven't configured any "user defined" TIMERS, SYSBIOS selects TIMER0.  TIMER0 is a 64bit timer, however you have also clarified that SYSBIOS only uses 32bits.  You have also clarified that SYSBIOS selects the lower half.  SYSBIOS must use the supplied CPU frequency from the platform file, combine with the Tick Period from the CLOCK tab, to program the TIMER.  This makes sense.  Now, for the HWI that is created for the TIMER interrupt.  You have provided the mapping that SYSBIOS uses to determine which HWI vector gets plugged based on which TIMER was selected.  Again for the default case of TIMER0 lower half, it looks like HWI 14 is used.  You have also clarified that HWI masking option is set to SELF.  There is no GUI way to "see" which HWI vector SYSBIOS is using or "see" the HWI masking option. 

    Now if you do include the TIMER module, and create a user defined TIMER, by default the TIMER module uses TIMER0.  If you left the CLOCK module with Timer ID = ANY, now things get confusing again.  Lets assume that the entire 64bits of TIMER0 is used by the TIMER module.  This means the CLOCK module must now use TIMER1 lower half.  This means the HWI vector is moved to HWI 15.  Things really get crazy if the user defines two TIMERS in the TIMER module(TIMER0 and TIMER1).  Now the CLOCK module is down to using TIMER2.  This means the HWI vector is now HWI 6.  My system already has HWI's 4 through 12 used, so I have no idea what happens now.  Basically, because SYSBIOS keeps things hidden and un-modifiable, I'm unable to balance my system correctly.  This was easy to do in DSPBIOS.

    Thanks, Dean

  • Dean,

    #3.  In the Clock module, the Timer ID there should match whatever is in the Timer module.  So your mapping above is not right.  It is still as what I say.  0 will use Timer 0 lower half, 1 will use Timer1 lower half, etc...  Unless you actually change the default half to be the upper half.  We do not have a virtual id to physical timer id mapping for this timer.

    Would it make sense for you to specify Timer 0 for the Clock?  Then when you create your own timers, you can change the interrupt vector and hwi params?  ANY is there if you don't really care...in your case...it seems you do care so I would not use ANY.

    If you try to create Two Hwis for the same interrupt vector it will give you an error.

    Judah

  • I like your idea of forcing the CLOCK module to use a certain TIMER.  It puts the HWI vector in a known place, and if the TIMER module then tries to create a TIMER with the same ID, it will throw an error.

    It appears my only logic failure was trying to match up the Timer ID 0-7 to the real C6748 timers.  So for the C6748, even though the drop down shows 0-7, I should only use 0-4.  Good to know.

    In summary (more for my notes than anything).

    1.  In the CLOCK module, set the Timer ID to 1.  This will force SYSBIOS to use TIMER1, and the HWI vector that gets plugged is number 15.

    2.  Since the HWI vector will be forced to 15, I can add / delete / change the rest of my HWI's around without bumping into the CLOCK TIMER.

    3.  The CLOCK TIMER HWI defaults to SELF masking, and there is no way to change that.  Since this is the lowest priority in the system, it shouldn't be a problem.

    4.  If / when I create my own user defined Timer (using the TIMER module), it will default to TIMER0.  Should work just fine with no conflicts.  However, if I create more than one user defined Timer, I will need to skip TIMER1.

    5.  If I don't need user defined Timers, there is no need to include the TIMER module (neither the generic one nor the device specific one).  Even though the CLOCK module users a TIMER, it all happens "behind the scenes".

    6.  There is a bug (or limitation) in the SYSBIOS GUI.  It sometimes shows you selections that you shouldn't see for your device.  Timer ID should only show 0-4 for the C6748, however it shows 0-7 as valid options.  It appears this a common theme with SYSBIOS, as I came across a simular thing with changing L1D in the CACHE tab.

    Judah, thanks again for your help.