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?
<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.