Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
Testing SPI MAX6957 - method ?

 
Post new topic   Reply to topic    Forum Index -> General
Author Message
ndudman



Joined: 25 Dec 2008
Posts: 79

Posted: 02 January 2009, 11:52 AM    Post subject: Testing SPI MAX6957 - method ? Reply with quote

Is it a bad idea, for testing purposes on my MAX6957 (20 pin io expander) to set up half (10 ports) as output and 10 as input, and connect them together. Output -> input... then write to output ones... and read back from input and check they correspond.

Perhaps a naive question, but it seems like a good idea to me Smile... to simply test the code without any other hardware.

Am I missing something important ?

Neil
Back to top
spamiam



Joined: 13 Nov 2005
Posts: 666

Posted: 02 January 2009, 13:15 PM    Post subject: Reply with quote

No reason you can't do it! One thing to consider when you are setting up a pin for input is whether you need the pull-up enabled, or whether you need an external pull-up (or pull-down in some cases). The promary consideration is whether the input to the pin is going to be actively driven both high and low. Come are high and off (tristate). In the tristate situation, your input pin will randomly vary high and low causing inconsistent results when you read the pin.

In the case of a ZX output pin, it will be driven high and low so you do not need to use any pull-up. This may not be the case for a different signal source.

-Tony
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR

Posted: 02 January 2009, 17:47 PM    Post subject: Reply with quote

Just to avoid possible confusion, Tony's comment about pullup resistors applies to the I/O pins of the ZX, not to those of the MAX6957. The MAX6957 is connected via an SPI interface and its I/O pins can be configured to be either a high impedance input, a push-pull output or a common anode LED segment driver.

There is no reason that you couldn't connect the I/O pins as you've suggested in order to perform a simple test.

One final note is that the SPI control lines on the 24-pin ZX devices are available on the through-holes on the left end of the ZX between pin 1 and pin 24 (see the ZBasic Reference Manual). It might be convenient to solder a set of square pins in that set of holes and then make a "harmonica" connector pigtail to connect the signals to your breadboard. That's how we have our test devices set up here (see picture below). Generally, we install the strip of 7 pins by inserting them from the bottom and then carefully soldering from the top side of the board. Then, we carefully pry the plastic keeper strip away from the bottom of the board and slide it off the pins and then clip the pins flush with the bottom of the board.



zx_with_square_pins.jpg
 Description:

Download
 Filename:  zx_with_square_pins.jpg
 Filesize:  75.87 KB
 Downloaded:  2948 Time(s)

Back to top
ndudman



Joined: 25 Dec 2008
Posts: 79

Posted: 02 January 2009, 20:41 PM    Post subject: Reply with quote

Tony, Dom

Thanks for the info and conformation that my idea was nt dangerous some how. I understand about the spi pins available as external pins and was going to use them. But thanks for the idea of the connector... BUT

where can I get "harmonica" connector pigtail Ive not heard of that before, something like the ribbon cables and plugs for IDE hard disks etc or similar ?

Neil
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR

Posted: 02 January 2009, 21:17 PM    Post subject: Reply with quote

ndudman wrote:
where can I get "harmonica" connector pigtail Ive not heard of that before, something like the ribbon cables and plugs for IDE hard disks etc or similar ?
You can get the harmonica connector housings with different geometries (e.g. 2x4, 1x8) at well-stocked electronics stores. You buy the crimp terminals separately, attach them to the individual wires and then snap them into the harmonica housing to make the pigtail. The picture below is an example of a 1x6 harmonica connector.

You can often salvage suitable connectors from electronic equipment (PCs, etc.). You're looking for a single-in-line connector on 0.100" centers.

You can also use IDC ribbon cables (e.g. hard drive cables). Even though they are dual row, you can use just one of the two sets of pins (odd or even).



1x6_harmonica.jpg
 Description:
 Filesize:  33.1 KB
 Viewed:  4018 Time(s)

1x6_harmonica.jpg


Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> General Time synchro. with the server - Timezone/DST with your computer
Page 1 of 1

 


All content Copyright © 2005-2012 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group