Altera_Forum
Honored Contributor
20 years agosampling technique
hi there....i'm a user of nios I , currently my project using this nios requires to obtain data (sample data) every 50 micro seconds. How do i do this ? any idea?
--- quote start ---
<!--quotebegin-niceguylow@Dec 10 2005, 08:37 AM hi there....i'm a user of nios i , currently my project using this nios requires to obtain data (sample data) every 50 micro seconds. how do i do this ? any idea?
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=11462)
--- quote end ---
--- Quote End --- There are a couple other things which influence your question: - What is the system clock speed? - How much data do you want to store <=> acquisition time Assuming your clock speed is 2 MHz, and you store data every 50 us (20kHz), then you have to wait 100 system clocks before you store data. So a self loadable down counter can do this, the counter starts with value 99, then counts down to 0 and when it is 0 it has to generate a pulse which does two things: 1: reload the counter to 99 2: store data from an input to memory So the pulse is active when the counter value equals 0. Instead of loading the counter with a constant value you can also copy that value form a programmable register. (flexibility). If you have enough clocks between the sample moments, you can store the data in external memory, or on disk? depends on the total acquitition time.... This is how you can do it, you can do it also with software (timer interrupts) but then sample accuracy might be an issue. <div align='right'><{post_snapback}> (index.php?act=findpost&pid=11463)</div> [/b] --- Quote End --- Hi.. Actually, my projects besides involving sampling, each sampled data is obtain then calculate the duty ratio to generate pwm output , which also means that each generated output is based on the previous sample data. besides that, my frequency uses 33.333 MHz and this system goes continuously. At the same time, the period of the generated pulse with shall be the same with the perios of obtaining samples which is 50us. If i insist on using timer interrupt, would it be possible? Please advise me... Thanks and regards, Wayne.