sysAuxClkRateSet, etc. - VxWorks

This is a discussion on sysAuxClkRateSet, etc. - VxWorks ; I'm setting the aux clock to 1000 ticks per second. I also have a "while (1)" loop with a pause() in it, waiting for a signal. Every 20 ticks (in the aux clock interrupt handler) I kill(SIGUSR2) to end the ...

+ Reply to Thread
Results 1 to 12 of 12

Thread: sysAuxClkRateSet, etc.

  1. sysAuxClkRateSet, etc.


    I'm setting the aux clock to 1000 ticks per second. I also have a
    "while (1)" loop with a pause() in it, waiting for a signal. Every 20
    ticks (in the aux clock interrupt handler) I kill(SIGUSR2) to end the
    pause when I transmit a serial message.

    The good news is that the serial messages stream out at a more or less
    constant rate. The bad news is that the rate is 100Hz and not 50Hz as I
    would expect.

    I'm using Tornado 2.0.2, VxWorks 5.4 (I think) and a Radstone EP1A with
    a V1.2/6p3 BSP.

    Also, I have a handler for SIGUSR2 but it doesn't do anything. Maybe it
    should but I don't know what. I'm not making any other use of signals.

    Maybe there's a better way of doing this but again I don't know what.

    Does anyone have any ideas? Thanks.

    --
    Fenster

  2. Re: sysAuxClkRateSet, etc.

    Does your board even have an AuxClk? I'm unfamiliar with the board you
    mention. Could you give me some details about it?


  3. Re: sysAuxClkRateSet, etc.

    In message <1142219532.977518.206700@j52g2000cwj.googlegroups. com>, zap
    writes
    >Does your board even have an AuxClk? I'm unfamiliar with the board you
    >mention. Could you give me some details about it?
    >

    It does have an AuxClk. It's a Radstone SBC based on the MPC8240 with a
    64-bit VME interface. It has four built-in timers, Timer0 is the
    AuxClk. What details would you be interested in?

    I have filed a query with Radstone but often responses from the
    newsgroups are faster than technical support departments...

    --
    Fenster

  4. Re: sysAuxClkRateSet, etc.

    Do you have visionClick?


  5. Re: sysAuxClkRateSet, etc.

    In message <1142281528.856584.240670@i39g2000cwa.googlegroups. com>, zap
    writes
    >Do you have visionClick?
    >


    I don't know what it is but I can't find any reference to it in the help
    so I'd have to say no...

    --
    Fenster

  6. Re: sysAuxClkRateSet, etc.

    Fenster wrote:

    >In message <1142281528.856584.240670@i39g2000cwa.googlegroups. com>, zap
    > writes
    >>Do you have visionClick?

    >
    >I don't know what it is but I can't find any reference to it in the help
    >so I'd have to say no...


    VisionClick is the host software that is used operate VisionICE, a JTAG
    ICE, i.e., an In-Cirtuit Emulator that connects to the target using a
    JTAG port. Together, VisionClick and VisionICE form a debugger that,
    unlike the GNU debugger used to debug applications, runs independantly
    of any target code. This allows it can be used to debug the startup
    code and other OS code that are difficult or impossible to debug using
    the GNU debugger.

    --
    ================================================== ======================
    Michael Kesti | "And like, one and one don't make
    | two, one and one make one."
    mrkesti at comcast dot net | - The Who, Bargain

  7. Re: sysAuxClkRateSet, etc.

    Hey

    I could think of easier ways to accomplish this thing, but this should
    work too.
    My question is,
    1. How did u measure the rate ur getting ? (100Hz and not 50Hz) The
    problem could be in ur measurement.
    2. Are you sure ur clock is set to 1000 ? I've seen BSPs that have
    trouble setting clocks for rates that are not the power of 2. I didn't
    work with 8240, but had the pleasure of working with 8260/70/71 it
    should be similar ?

    take care
    Sinan


  8. Re: sysAuxClkRateSet, etc.

    In message <1142363446.568905.3600@j52g2000cwj.googlegroups.co m>, sinan
    writes
    >Hey
    >
    >I could think of easier ways to accomplish this thing, but this should
    >work too.
    >My question is,
    >1. How did u measure the rate ur getting ? (100Hz and not 50Hz) The
    >problem could be in ur measurement.


    I output a serial message on the "tick" and checked the time between
    messages with a digital oscilloscope.

    >2. Are you sure ur clock is set to 1000 ? I've seen BSPs that have
    >trouble setting clocks for rates that are not the power of 2. I didn't
    >work with 8240, but had the pleasure of working with 8260/70/71 it
    >should be similar ?


    I used sysAuxClkRateGet to confirm that the rate was set correctly. I
    appreciate that this isn't 100% guaranteed but it is the only mechanism
    that I have (as far as I'm aware).

    The fact that it's a factor of two out makes me suspicious that the
    "counting interrupts" are being generated from both edges of the base
    clock.

    --
    Fenster

  9. Re: sysAuxClkRateSet, etc.

    Hey

    Oh, so it's a much lowlevel problem..
    If you connected your own routine in sysAuxClkRoutine it should be
    called once when a tick happens (1000 ticks/sec). So if you flip some
    led every 20 ticks it should be 50Hz, vxworks will not call your
    routine on rising/falling.

    When u say a "serial message and measured with a scope" what do u mean
    ?! you pump something thru SPI or thru some GPIO ? A LED again is your
    safest bet, just auto-trigger the scope and see.

    If you suspect some problems with your clock, If it's your own board
    and BSP and not something with a ready made BSP, I would check the
    OSCILLATOR_FREQ to see if my timers are being configured correctly. I
    recall that in the timer drv of the 8260 the sysAuxClkEnable uses the
    SYS_CPU_FREQ (which equals the oscillator freq).

    If your using your own board, try running the same code on an
    evaluation board you know is working.

    Hope this helps.
    Keep me posted
    Sinan.


  10. Re: sysAuxClkRateSet, etc.

    1.You end the pause every 20 ticks and kill the signal,why do you not
    set the auxclock 50 ticks/second?
    2.The routine what you connect to the auxclock is a ISR,I can not
    confirm that the pause() can be used in a ISR
    3.You can send a event to another tast in the ISR and the task send a
    packet,you can capture the packets and get
    the delta time between two packets,so you can know the freq...


  11. Re: sysAuxClkRateSet, etc.

    In message <1142568429.093557.82840@j52g2000cwj.googlegroups.c om>, grin
    writes
    >1.You end the pause every 20 ticks and kill the signal,why do you not
    >set the auxclock 50 ticks/second?
    >2.The routine what you connect to the auxclock is a ISR,I can not
    >confirm that the pause() can be used in a ISR
    >3.You can send a event to another tast in the ISR and the task send a
    >packet,you can capture the packets and get
    >the delta time between two packets,so you can know the freq...
    >


    1. I have other things to do off the ISR, more frequently than 50Hz, but
    this illustrated my problem quite clearly without cluttering the
    explanation with detail.

    2. The pause() was being called from the main, spawning task not from
    within the ISR. I have since found some other problems (not all of them
    resolved yet) and I've since designed the pause() out of the system.

    3. This is more or less the design I've since adopted, using a binary
    semaphore from within the ISR to trigger the serial transmission. The
    double frequency problem remained.

    I have since discovered the cause the problem; a sysAuxClkInit() call is
    inserted automatically into the kernel build if the auxiliary clock
    component is added. The result, because I was calling it too, was that
    my ISR was being chained in twice and I ended up with double frequency
    data output (and everything else).

    Thanks for all your comments/help.

    --
    Fenster

  12. Re: sysAuxClkRateSet, etc.

    good lucky


+ Reply to Thread