Go to Post Question: How can you tell the difference between an engineer and a programmer? Answer: You ask them to count. Engineers start counting from 1. Programmers start counting from 0. - Ed Law [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 24-02-2005, 11:42
ConKbot of Doom ConKbot of Doom is offline
Team Alumni
FRC #1184 (Cobra Robotics)
Team Role: Leadership
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Maryland
Posts: 153
ConKbot of Doom has a spectacular aura aboutConKbot of Doom has a spectacular aura aboutConKbot of Doom has a spectacular aura about
Inversion of the digital IO pins

I was hoping to use an external EEPROM to store data for our autonomous routine, it uses an I2C interface, but I have code written to bit-bang, so that is ok, but here is my question. I know the pins are inverted as an input, since when they are low, you get a 1 in software, and when they are high, you get a 0. But are they inverted as outputs too?

Thanks
  #2   Spotlight this post!  
Unread 24-02-2005, 12:48
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,112
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: Inversion of the digital IO pins

Quote:
Originally Posted by ConKbot of Doom
I was hoping to use an external EEPROM to store data for our autonomous routine, it uses an I2C interface, but I have code written to bit-bang, so that is ok, but here is my question. I know the pins are inverted as an input, since when they are low, you get a 1 in software, and when they are high, you get a 0. But are they inverted as outputs too?

Thanks
They're not inverted in my experience, as either input or output. You might be thinking of the fact that they're internally pulled up to 5 volts, so a switch to ground reads as a logic 1 when it's open and a logic 0 when it's closed.
  #3   Spotlight this post!  
Unread 24-02-2005, 13:01
Ryan Cumings's Avatar
Ryan Cumings Ryan Cumings is offline
Programmer and University Rejected
#0134 (Team Discovery)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2000
Location: Pembroke, NH
Posts: 65
Ryan Cumings is an unknown quantity at this point
Send a message via AIM to Ryan Cumings
Re: Inversion of the digital IO pins

Quote:
Originally Posted by Alan Anderson
They're not inverted in my experience, as either input or output. You might be thinking of the fact that they're internally pulled up to 5 volts, so a switch to ground reads as a logic 1 when it's open and a logic 0 when it's closed.
I thought that a pull up floated high which meant that it will always read as a logic 1 unless you ground the signal pin
__________________
Suddenly being rejected from college feels right during the build season. Now I am a mentor.
  #4   Spotlight this post!  
Unread 24-02-2005, 13:37
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,112
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: Inversion of the digital IO pins

Quote:
Originally Posted by Ryan Cumings
I thought that a pull up floated high which meant that it will always read as a logic 1 unless you ground the signal pin
You thought correctly. As I said, closing the switch to ground yields a logic 0.
  #5   Spotlight this post!  
Unread 24-02-2005, 16:06
Unsung FIRST Hero
Matt Leese Matt Leese is offline
Been-In-FIRST-Too-Long
FRC #1438 (The Aztechs)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1998
Location: Long Beach, CA
Posts: 937
Matt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond reputeMatt Leese has a reputation beyond repute
Send a message via AIM to Matt Leese
Re: Inversion of the digital IO pins

A pullup does not imply inversion. It just means that when you leave it floating, you will get a logic one on the input. If you have an input connected to it that will pull the input down, then you will get a logic zero as the input.

Matt
  #6   Spotlight this post!  
Unread 25-02-2005, 12:41
ConKbot of Doom ConKbot of Doom is offline
Team Alumni
FRC #1184 (Cobra Robotics)
Team Role: Leadership
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Maryland
Posts: 153
ConKbot of Doom has a spectacular aura aboutConKbot of Doom has a spectacular aura aboutConKbot of Doom has a spectacular aura about
Re: Inversion of the digital IO pins

Nevermind, limit switches, use OPEN and CLOSED, not a bit test... bah sorry
Its been a long 6 weeks... (*mutters on about being designer, team leader, and programmer...*)

I thought that they made it so that when the switch was closed, the bit read 1, and when it was open it read 0.

in user_routines.h
Code:
#define OPEN        1     /* Limit switch is open (input is floating high). */
#define CLOSED      0     /* Limit switch is closed (input connected to ground). */
I guess I won't have to modify my programs after all...
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Digital Caliper as a Digital Readout on Small Mill sanddrag Technical Discussion 9 13-10-2005 22:51
Dynamic Input/Output Changing Paolo Control System 6 23-09-2004 19:09
[ECDU]: CHAT-7/19 Corey Balint FIRST-related Organizations 5 19-07-2004 23:44
heres the code. y this not working omega Programming 16 31-03-2004 15:18
digital inputs not valid just after initialization? WizardOfAz Programming 2 26-01-2004 13:21


All times are GMT -5. The time now is 10:57.

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