Main Site Documentation

Gpio


#1

Hello !
i’m little confused about GPIO , and i need your help . that is what i understand (i think):
i can use the pin with different configuration output , input and tristate , when i use the pin input configuration i can tell if i want use the internal resistor or if i want use an external resistor and with external resistor i can have 3,3 or 5V right ? when i use pin output configuration they are in open collector ? or they use one internal pull up resistor ? if i use external resistor i can connect to 5 V ? and use 3,3V just for the micro controller power ? tristate i can read or write on the same pin . Sorry guys but i have a big mess in my mind

thank you
Sergio


#2

That is incorrect. The pull resistors are only applicable when the pin is an input. The output will always be 3.3V level.


#3

Thank you so much now is clear , and in that wanna mean if i need the control the bus of HD44780 i don’t need output resistor because the micro controller have inside . I use external resistor when i control for example one led

Sergio


#4

hi Sergio,

I think you have many things confused. Please tell us what you want to achieve.

Here’s what I think you want, though.

HD44780 LCD will work on a 3v3 output logic pin. You will connect each input on the LCD to an output pin on the Fez. You do not need a resistor. For power of items like the backlight and contrast, you may have to try using the direct 3v3 power rail to see if your device will work with that; some may not. If they don’t work with that, then you can simply use the 5v power rail instead, which doesn’t affect the digital output pins at all, they still operate at 3v3.


#5

Hi Brett,
yes you have right i have so many things confused , but you make soooo clear .

thank you soooo much

Sergio


#6

–3.3V/5V tolerant - You are working with TTL (3.3V) signals. There is a huge, obvious, difference to a microcontroller between +3, 0, and -3 volts. If you crop a 5V square wave at 3.3V, it doesn’t change the signal’s width, postition, or timing (frequency), only its height (amplitude).
–Another thing to note is that USB is not a wall outlet. It provides only about 500ma total, per port. Your microcontroller and everything it controls must be within that or you will need to add more power.

Input:
–You can read this pin’s state
–The resistors feed VCC or GND to the pin and that will be the state that the pin tries to maintain. If you wire a switch to VCC and a GPIO, it is obvious that you are expecting to react to a VCC signal at the pin. The factor you are overlooking is that when the button is not pushed, you are [em]expecting[/em] the pin to be low. You cannot [em]expect[/em] a pin to be high or low; you must tell it to be so.
–The resisters are small and wired to the pin and VCC or GND; they provide or sink only enough current to turn 3.3V logic (TTL) high or low. Because of that, you can wire most IC’s directly to each other. Definitely keep checking datatsheets, as you did. The resistors are important to know, and you’ll spend a lot of time in the register maps, as well.
–LED’s do not provide resistance like light-bulbs and gas lamps do; they use any and all available current, including the current the microproccessor needs to run. Use a resistor when driving them directly from the processor to limit their current draw. Microprocessor aside, if you hook any LED up without a resistor to any sufficiently powerful power supply, the LED will, literally, fry; you can make any color LED glow orange by omitting the resistor.

Output:
–You may source VCC or sink GND at up to a few 100ma, typically. Your microprocessor will easily overpower the signal supplied by the chips internal resistors, if any, to affect the remote pin’s active state. The timing of the two and what data you are encoding is up to you and/or the chip manufacturer.

Tristate:
–Input mode (Inactive)
Applies internal resistors, providing meaningful data at the pin.
–Output mode (Active)
Disables internal resistors without releasing and redefining the pin; the pin can source or sink as usual.

This module schematic from GHI will explain how to set up the chip and where resistors are needed.
http://www.ghielectronics.com/downloads/Gadgeteer/Module/Display%20HD44780%20sch.pdf
Are you using the GHI module or a standalone chip?

The Gadgeteer source code includes a driver for this module
http://gadgeteer.codeplex.com/SourceControl/changeset/view/24955#256115

And you could implement any missing or enhanced functionality:
http://en.wikipedia.org/wiki/Hitachi_HD44780_LCD_controller


#7

Thank you Kerbal , thank you so much

Sergio


#8

@ Giants - No problem. I am new too, so you might want to check back to see if I’ve been corrected.