Go to Post Many people follow that advice, as if Ohio is Mordor or something. - Travis Hoffman [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 01-02-2014, 09:08 AM
GrimmReaper's Avatar
GrimmReaper GrimmReaper is offline
Registered User
FRC #2046 (Bear Metal)
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2011
Location: Maple Valley, WA
Posts: 24
GrimmReaper is on a distinguished road
Getting additional GPIO ports

So I wanted to share an extension our team put together last year to allow us to have more GPIO ports without adding another digital module + sidecar.

We built 2 methods, one utilizing a simple MUX chip. Another utilizing a standard I2C based GPIO chip. We utilized the I2C based one on our robot and it worked pretty well.

The MUX chip uses 5 DIO's from the sidecar to get you 16 on the mux. Additionally there is lag time to read each pin so it's overall a slow and cumbersome implementation. But we tested it out and included it for reference.

The I2C version is fairly smart, retrieves every pin value once per DriverStation packet, so only the first pin-get on the board makes an actual call to the board and gets all values at once, subsequent calls in the same frame will retrieve the cached values from the first call(unless forced).

There are notes about the classes within the files, including which boards/chips were tested. One note, on the DFRobot I2C board, we had the best luck if we did actually supply 5V power to the power terminals on the board. Without that we had intermittent issues with the board.

Files are attached. If you have any questions or comments, please post them :-)

- Jon
Attached Files
File Type: zip GPIO_Extensions.zip (8.4 KB, 14 views)
Reply With Quote
Reply


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 09:54 AM.

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