Nios® II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.

PeriodL & PeriodH

Altera_Forum
Honored Contributor II
1,425 Views

I understand that timeout period determines the period of your interrupt.  

I also understand that periodL and periodH is holds the LSB and MSB 16bit value of the period register.  

My question is how do i know what value to put into these registers to change my timeout period?
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
103 Views

period register = timeout period x timer frequency 

For example if your timer runs at 50Mhz and you need a 50ms period, you must 

write the period register 0.05 x 50M = 2500000. 

2500000 dec = 2625a0 hex : then periodH = 0x26 and periodL = 0x25a0.
Altera_Forum
Honored Contributor II
103 Views

It seems strange to me that Altera haven't supplied 32bit versions of the timer devices. I presume the 16bit versions have been carried forwards from an earlier design - It isn't as though a 32bit version would be difficult to write from scratch! 

 

It is worth checking that you don't need to subtract 1 from the count - check the datasheet/pdf.
Altera_Forum
Honored Contributor II
103 Views

Sorry, actually the correct formula is: 

period register = timeout period x timer frequency - 1 

Thanks to dsl for pointing out the mistake.
Reply