ZPUino is a system-on-a-chip comprising one small CPU (ZPU 32-bit processor core), a few devices and it's meant to be implemented on a FPGA and mimic, the successfull Arduino platform. Hardware wise, ZPUino currently integrates two generic timers, which are able to generate PWM signals.
Main Goal: In this wiki page, we will focus only on the timer side. Right now, if you want to do configuration setup you have to write it manually within registers, which is beyond the skills of many end users. That's why a timer library is provided in C language to make abstraction level higher. So, this wiki page is considered as a simple guide to help using this library without referring to datasheet.
According to the ZPUino 1.0 datasheet, we find the fllowing specifications:
This class is the base of any timer implementation, deriving from REGAccess Class. It provides low-level access to the timer configuration in hardware, so you should not use it directly. This class implementaion has one private attribute: m_inline, which refers to the interruption line number, and a set of public methods as following:
This class is a higher implementation of the TimerInstance_Class class, deriving from BaseDevice class. It contains many private attributes, essentially you find m_timers array to save timer instances (2) and m_interTimer variable which refers to the active one. Since you are not concerned by the internal behaviour of this class, you should only understand the following public functions, so you can use them in your software:
I hope this wiki page helps expalain the use of timer library with PWM modes of ZPUino. Please let me know if you encounter any problem.
Nassim TLILI
Embedded Software Engineer
LPI Linux Professional Certified
mail: nassim.enit@gmail.com