|
|
| Author |
Message |
ndudman
Joined: 25 Dec 2008
Posts: 79
|
|
Posted: 02 January 2009, 11:52 AM Post subject: Testing SPI MAX6957 - method ? |
|
|
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 ... 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: |
|
|
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: |
|
|
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.
| 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: |
|
|
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: |
|
|
| 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).
| Description: |
|
| Filesize: |
33.1 KB |
| Viewed: |
4018 Time(s) |

|
|
|
| Back to top |
|
 |
|