stolzie said:
Thanks Blueteeth for your reply. I will have to do the maths and work out the best value resistor to use.
As for your 128 I/O board that is a lot of I/O's!
May I ask how you actually implemented that number of I/O's?
I have been looking at the GPIO expanders from Microchip that use SPI to get more I/O's but obviously there are a number of different ways you can go about implementing this sort of stuff.
Sure, it was actually for a CPLD (several to be precise) which were a bit funny about I/O's, they probably should have all been buffered as each chip could only sink about 100ma.. they got hot
As for expanding I/O's, for SPI, shiftregister obviously, simple serial to parallel. For each 'shift register' you'll need a CS (chip select) line, which could be used as both an 'enable line', so the shiftregister accepts the data, and as a 'strobe' line, which loads in the new bits to the outputs. It'll mean you'll have to write at least a new byte if you want to change just one bit, but a micro has more than enough memory to store all the current values. You just need to XOR the old byte with the a byte of bits you want to change.
If you use 8-bit SR's, because you'll need a CS line for each one, that limits how many I/O's. For say SPI and 10 I/O's on your micro, that exapnds to 80 I/O's. You could stick two shift registers in series, pull its CS low, write TWO bytes, then pull the CS high again, so thats 16 I/O's per CS line, giving 160 expanded I/O's. As for chips, I used the CD4094 (or HEF4094?) and the 74HC164. The former was better because it buffered the output, meaning instead of the pins 'seeing' the shift, they remained the same state until a 'load' line loaded in the new value. Sorry, I'm ranting, but its how I've done it, and it works like a charm, god bless SPI
Nigel Goodwin said:
Can you think of one?.
I suspect (as it looks like you do?, from the long explanation you posted!) that he doesn't understand what they really do, and how they do absolutely nothing if the I/O is configured as an output.
Well, if he didn't understand what pull ups are for, he does now. And the reason I typed such a long message is because I tend to rant, and also, he asked for advice. A simple 'pointless' doesn't really help much. For practical purposes, you are right of course, they don't do much, but they do do something if their value is chosen to be too low, which they shouldn't be. I'm not arguing here, I simply wanted to answer a question, after all, this board is a great place to learn, and share idea's.
As for your 'clients board' stolzie, your solution of an FET controlled pull up system does seem to be a reasonable 'substitute' for a PIC internal pull-ups, if not a little overkill (uses up a precious I/O), I'm almost certain that they will be fine permentantly connected, as long as the value is high enough. No real maths needed, I'd say 10k-47K, maybe 100k would be a little too high, but this isn't an exact science its only there to pull pins high, I can't think of a situation where they would cause problems when the pins are outputs.
Good Luck,
Blueteeth.