Go to Post I'm sure they liked the size and power output but disliked when they were on fire. - notmattlythgoe [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 17-01-2006, 21:17
Jake M Jake M is offline
void* Jake;
FRC #1178 (DURT)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Missouri
Posts: 118
Jake M has a spectacular aura aboutJake M has a spectacular aura about
Analogs.....

I probably know the answer to this question, but I'm not that good with techincal terms. What is an analog input? What's the difference between an analog and, say, a digital.
__________________
Code:
void function(void)
 {
  function();
 }
  #2   Spotlight this post!  
Unread 17-01-2006, 21:23
MacFlightSierra MacFlightSierra is offline
Registered User
FRC #0912 (Iron Lyons)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Toronto
Posts: 19
MacFlightSierra is an unknown quantity at this point
Re: Analogs.....

In the FIRST controller there are analog and digital inputs/outputs. The analog ones accept a voltage 0 - 5v, and give a value of 0 - 1023 in code. The digital ones give a 0 [zero] on the contact [between GND and signal pin], and a 1 [one] when the pins are left open.
  #3   Spotlight this post!  
Unread 17-01-2006, 21:23
Joe Hershberger Joe Hershberger is offline
National Instruments
AKA: jhersh
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 1997
Location: Austin, TX
Posts: 148
Joe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to all
Re: Analogs.....

Quote:
Originally Posted by Jake M
I probably know the answer to this question, but I'm not that good with techincal terms. What is an analog input? What's the difference between an analog and, say, a digital.
Jake,
Basally a digital signal is an analog signal that follows certain rules.

An analog signal is basically ANY signal. It has no restrictions. Digital signals are (in the case of the 5v CMOS levels used on the RC) signals whose voltages ideally only equal 5V or 0V.

Those signals, because they can have only 2 values, can be encoded as a 0 or 1 (a single bit) in the microcontroller. The analog signals (bounded to 0V to 5V for this microcontroller) can be anything in between. The values are therefore encoded as a number between 0 and 1023 (if using the ADC in 10-bit mode) or 0 to 255 (8-bit mode). The values are evenly distributed across the range. So the Voltage = Code * 5V / 2^(bitwidth). Bitwidth being the setting of the ADC (8 or 10).

Cheers!
-Joe

Last edited by Joe Hershberger : 17-01-2006 at 21:28. Reason: correction
  #4   Spotlight this post!  
Unread 17-01-2006, 22:33
Mike's Avatar
Mike Mike is offline
has common ground with Matt Krass
AKA: Mike Sorrenti
FRC #0237 (Sie-H2O-Bots (See-Hoe-Bots) [T.R.I.B.E.])
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: Watertown, CT
Posts: 1,003
Mike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond repute
Re: Analogs.....

Seems like your answer has been given, but I have a tad more things to add.

As many have said, an analog input is a range of values. If you have a 10 bit ADC (Analog to Digital Converter) it will be a 10 bit number (0 to 1023), 8 bit ADC is 0 to 254, etc. Our controller has a 10 bit ADC.

Analog devices work by taking a voltage in, applying resistance to it depending on a mechanical device and then outputting the modified voltage. That modified voltage is connected to the input pin of an ADC. The ADC is also connected to what is called a reference voltage. This reference voltage is what the inputted voltage will be compared to. It's kinda hard to explain, examples show it better:

Reference voltage: 5v
Input voltage: 5v
ADC: 10 bit
Output given: 1023

Reference voltage: 5v
Input voltage: 5v
ADC: 8 bit
Output given: 254

Reference voltage: 5v
Input voltage: 0v
ADC: 10 bit
Output given: 0

Reference voltage: 5v
Input voltage: 2.5v
ADC: 10 bit
Output given: 511Thanks Joe =)

So what it comes down to is: (InputVoltage / RefVoltage) * ADCsize

Hope I helped,
Mike
__________________
http://www.mikesorrenti.com/

Last edited by Mike : 18-01-2006 at 12:44.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 01:04.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi