Post Go back to editing

can I use gp timer X as a prescaler for gp timer Y?

Category: Hardware
Product Number: ADSP-BF703

i want to achieve a microsecond gp timer.  SYSCLK is 100MHz so the timer need to a 1:100 prescaler.

this should be achievable by using several timers and the TRU.

ii see two ways to do this:

a) if there is a way to make a trigger tick the microsecond timer, I can use another timer as prescaler.  It would be very logical for a gp timer to be able to count trig events but I cannot figure out how to do this by reading the hw documentation or EE360.

b) use a single timer or two synchronised timers to start/stop the microsecond timer through the TRU to make it run 1% and be idle 99% of the time.

please advice what would be the best way to achieve this, preferably with a few lines of code how to setup the registers too.

thanks.

Parents
  • Hi Rudberg,

    We understand that you're looking to generate a microsecond timer, but we're unsure about the two approaches you've proposed.

    If our understanding is correct, please refer to the attached project, which provides a simple example for generating a 1-microsecond timer for the ADSP-BF609 processor.

    GP_Timer_External_Input_Core0.zip

    In this example, the timer period and width are calculated as follows:

    The Timer Period is divided by the SCLK0.

    Timer_Period / SCLK0 = Time period (in microseconds)

    For example, to generate a PWM signal with a period of 1 microsecond at a 100 MHz SCLK0:
    Timer Period / 100 MHz = 1 µs
    Thus, Timer Period = 100.

    For a 50% duty cycle:
    Timer Width = Timer Period / 2
    Timer Width = 50.

    Please take this as reference and modify it as per your requirement.

    If this approach doesn’t fully address your needs, please provide more details so we can assist you effectively.

    Regards,
    Nandini.C

  • what I am after is a 32 bit counter value that ticks at 1MHz.

    I use a gp timer to create a trigger at 1MHz but what destination should I use?

    the gp counter doesn't seem to have any trigger input correct?

    the gp timers only accept trigger for start and stop, not for tick / count, correct?

    so... what would be the best way to create a 1MHz 32 bit counter?

Reply
  • what I am after is a 32 bit counter value that ticks at 1MHz.

    I use a gp timer to create a trigger at 1MHz but what destination should I use?

    the gp counter doesn't seem to have any trigger input correct?

    the gp timers only accept trigger for start and stop, not for tick / count, correct?

    so... what would be the best way to create a 1MHz 32 bit counter?

Children
  • Hi Rudberg,

    Regarding "what I am after is a 32 bit counter value that ticks at 1MHz."
    We understand that you are looking to implement a 32-bit counter that ticks at 1 MHz. Based on this, you could use the example that generates a PWM signal at 1 MHz. In the code, you can configure an interrupt handler to increment a volatile variable, which would then act as a counter. Please refer the attached code for your reference.

     0285.GP_Timer_External_Input_Core0.zip

    However, we are unsure about why you are considering the TRU for this setup. Could you please provide more context? Are you planning to use two timers in your application and is there a need for synchronization between timers?

    Regarding "the gp counter doesn't seem to have any trigger input correct?"
    >> Yes, your understanding is correct.

    Regarding "the gp timers only accept trigger for start and stop, not for tick / count, correct?
    >> Yes, the GP timers only accept triggers for start and stop operations, not for ticking or counting. Using the TRU, we can either start or stop the timer based on specific triggers.

    If the example provided does not fully align with your requirements, could you please share more details about your specific application/approaches? A block diagram or flow chart would be very helpful for us to offer better guidance.

    Regards,
    Nandini.C

  • hi again.

    i need an autonomous 32bit wrapping microsecond timestamp to be read anytime by the cpu .

    currently we use (core timer / 400) for this but it would be more convenient (faster) to read a single system MMR.

    i have working concept using two gp timers, the trigger routing unit and a gpio (TM_ACLKn for the second timer) but unfortunately we don't have any free pins to implement this in the final product.

  • Hi Rudberg,

    Thanks for sharing more details.

    We are checking on your requirement and will get back to you soon.

    Regards,
    Nandini.C