Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Question about sampling rate

Status
Not open for further replies.

Reychard

Newbie level 4
Joined
Oct 9, 2010
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
McMurdo Station
Activity points
1,324
Hi everyone,

I have a resistive humidity sensor which I'm using an ADC (ADC0804) to get values off. The specification of my project specify that the sensor has to sample the humdity at a frequency of 5Hz. I'm using a Spartan-3 board to interface the ADC. How am I able to do this? Obviously, I don't provide a 5Hz input clock to the ADC, so what is the correct way to go about doing this?

Kind regards
 

TI's datasheet offers a good explanation of the ADC0804's logic: **broken link removed**

Basically, run the ADC0804 at whatever conversion clock speed suites you, say 1MHz. Have another clock running at 5Hz to initiate a conversion and read the result (reading by /INT or another timer) by manipulating the ADC0804 /WR, /CS and /RD lines.

To save power, you could shut the conversion clock down between samples.
 
Thanks FoxyRick. I'm running my ADC at 50Khz and using a state-machine to go through the procedure. My VHDL code is as follows;

Code:
START_FSM	:	PROCESS (CURR_STATE, INTR)
					BEGIN
					
					READ_DATA <= '0';
					WR <= '0';
					
					CASE CURR_STATE IS
							
							WHEN STARTUP =>
								WR <= '0';
								READ_DATA <= '0';
								NEXT_STATE <= CONVERT;
								
							WHEN CONVERT =>
								IF (INTR = '0' AND STREAM = '1') THEN
									NEXT_STATE <= WAIT500;
								ELSIF (INTR = '0' AND STREAM = '0') THEN
									NEXT_STATE <= READ1;
								ELSE
									NEXT_STATE <= CONVERT;
								END IF;
								WR <= '1';
								READ_DATA <= '0';
															
							WHEN WAIT500 =>
								IF (COUNTER_WAIT = 5000) THEN
									NEXT_STATE <= READ1;
								ELSE
									NEXT_STATE <= WAIT500;
								END IF;
								COUNTER_WAIT <= COUNTER_WAIT + 1;
								
							WHEN READ1 =>
								NEXT_STATE <= CONVERT;
								WR <= '1';
								READ_DATA <= '1';
								
							WHEN OTHERS =>
								NEXT_STATE <= STARTUP;
					END CASE;
					END PROCESS;

Now, whenever READ_DATA is 1, I read the ADC output. So are you suggesting that I have a separate process running at 5hz where I check the status of READ_DATA and obtain the 8-bit ADC output? I've tried doing this and I get no values at all. If I run the clock at 50Mhz, I get values just fine.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top