Go to Post IF WildstangIsAwesome = True and SkaIsAwesome THEN Act = AWESOME End IF - Rohith Surampudi [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 13-02-2006, 23:17
CronosPrime1 CronosPrime1 is offline
Registered User
FRC #0321
 
Join Date: Jan 2006
Location: Hyperspace
Posts: 53
CronosPrime1 is an unknown quantity at this point
0 or 1?

Is a signal of +5V as opposed to 0V considered a digital 1 or a digital 0? Or does it depend on where? If so, can someone detail when +5V is 1 and when it's 0? I've been confused about this for a while...
__________________
  #2   Spotlight this post!  
Unread 13-02-2006, 23:24
phrontist's Avatar
phrontist phrontist is offline
Proto-Engineer
AKA: Bjorn Westergard
FRC #1418 (Vae Victus)
Team Role: College Student
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Falls Church, VA
Posts: 828
phrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond reputephrontist has a reputation beyond repute
Send a message via AIM to phrontist
Re: 0 or 1?

Quote:
Originally Posted by CronosPrime1
Is a signal of +5V as opposed to 0V considered a digital 1 or a digital 0? Or does it depend on where? If so, can someone detail when +5V is 1 and when it's 0? I've been confused about this for a while...
The digital inputs are pulled to +5v by defualt, so they are 1 when nothing is connected to them. Grounding them sets them to 0.
__________________

University of Kentucky - Radio Free Lexington

"I would rather have a really big success or a really spectacular crash and failure then live out the warm eventual death of mediocrity" - Dean Kamen
  #3   Spotlight this post!  
Unread 13-02-2006, 23:54
darist darist is offline
Registered User
AKA: David Aristizabal
no team
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Newark, NJ
Posts: 36
darist is an unknown quantity at this point
Re: 0 or 1?

Commonly:

+5V is a digital 1
0V is a digital 0

This is the case in the FIRST robot controller.

There are other protocols and standards that use different voltage levels to represent 1's and 0's, but I'm not aware of anything in the FIRST RC that is not 5V/0V.

As was mentioned before: remember that if you connect nothing to an input, they will default to +5V (not 0V) when the controller is on.

Good luck!
David A.
  #4   Spotlight this post!  
Unread 14-02-2006, 00:54
KenWittlief KenWittlief is offline
.
no team
Team Role: Engineer
 
Join Date: Mar 2003
Location: Rochester, NY
Posts: 4,213
KenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond reputeKenWittlief has a reputation beyond repute
Re: 0 or 1?

with digital logic the higher voltage signal is always called 1 or H, and the low voltag signal is always 0 or L.

The thing that is sometimes confusing is some signals are active low. For example, reset signals are usually active low. That simply means when you pull the signal low, the device is reset.

Active low signal names usually have a line over the name (not easy to do in a text editor) or the letter L or N tagged on the end, like: RESET_L.

There are electrical reasons why you would sometimes want a signal to be active low intsead of the normally active high, but it would take about a page of this thread to really explain it.
  #5   Spotlight this post!  
Unread 14-02-2006, 07:39
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: 0 or 1?

Quote:
Originally Posted by KenWittlief
with digital logic the higher voltage signal is always called 1 or H, and the low voltag signal is always 0 or L.
Never say "always".

What you're describing is called positive logic and is how most digital circuits work, including most of the Robot Controller. However, negative logic exists as well. RS-232 serial communication uses negative logic, with a positive voltage being logic 0 and a negative voltage being a logic 1.
  #6   Spotlight this post!  
Unread 14-02-2006, 16:22
paulcd2000's Avatar
paulcd2000 paulcd2000 is offline
Accidentally speaks in C
AKA: Paul Dagnelie
FRC #1719 (The Umbrella Corp.)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Baltimore
Posts: 368
paulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the roughpaulcd2000 is a jewel in the rough
Send a message via AIM to paulcd2000
Re: 0 or 1?

the best thing is (i know this isn't quite an answer) to test the device with a printf and find out when it returns 1 and when it returns 0
__________________
"People don't say 'It's just a game' when their team is winning!" -- Scott Adams

5.5 students (on average)* $7/h *210 hours/student= $8085 of labor, all volunteered (not counting mentors', who are each that much)

We have blades on our robot?! ***sweeeeeet***

There are 11 types of people in the world. Those who can read binary, those who can't, and those who say this joke is supposed to be, "There are 10 types of people in the world. Those who can read binary and those who have a life."
  #7   Spotlight this post!  
Unread 14-02-2006, 16:39
aaeamdar's Avatar
aaeamdar aaeamdar is offline
Post-A-Holic
AKA: Paul Dennis
FRC #1719 (The Umbrella Corp)
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2005
Location: Baltimore, MD
Posts: 231
aaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant futureaaeamdar has a brilliant future
Re: 0 or 1?

Quote:
Originally Posted by Alan Anderson
Never say "always".

What you're describing is called positive logic and is how most digital circuits work, including most of the Robot Controller. However, negative logic exists as well. RS-232 serial communication uses negative logic, with a positive voltage being logic 0 and a negative voltage being a logic 1.
It's CMOS (Complimentary MOS) versus MOS (metal oxide semi-conductor for those interested). They are two different methods of constructing gates. But I wont bore you young folk with that.

What you're probably really interested in is this: when that switch is not pressed, what is the RC hearing? When it IS pressed, what is the RC hearing? I use the word
Code:
"hearing"
figuratively.

This is most easily tested through the use of the wonderful and beautiful Ms. Printf (I'm in a valentiny mood here). Also, use #defines to good advantage so that you don't have to change a bunch of stuff!

Self-discovery for the win!

Best of luck,
Paul Dennis
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:33.

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