I read the app note, and I think I'm going to need a transistor switch to do this, but I'll ask the question anyway. I'd like to be able to just find the right pull-up value if that's possible.
What I have is an A6821 (http://www.allegromicro.com/datafile/6821.pdf) that I'm trying to read the serial output from. The datasheet doesn't indicate what the source/sink current is for the output (only that is low power CMOS), and with nothing connected to it, the voltmeter indicates that it's working properly. However, when I hook this up to the ZX40, if the pin is set to zxInputPullup, the read alwas reaturns a 1 (and the VM verifies that), so the 6821 clearly can't sink enough current. If I change the pin to zxInputTristate, it always reads 0 (can't source enough tto change the ZX input).
I'm pretty sure that I could put a transistor switch in and get it to work, but the board real estate is asking for only a pull-up resistor if possible. Any suggestions?
BTW, everything on the logic side is running at the std. 5V supply. The "drive" side of the 6821 is driving some 12V relays.
Having trouble interfacing LP CMOS to ZX40
Having trouble interfacing LP CMOS to ZX40
> ... only a pull-up resistor if possible...
The Allegro spec appears to indicate a normal CMOS data output, with
high >2.8v and low <0.3v with a 5v supply @ 200uA, the equivalent of a
~47k load. You should need no pullup on the ZX input pin but one
shouldn't affect the data, either.
I suspect something else is at fault.
Tom
The Allegro spec appears to indicate a normal CMOS data output, with
high >2.8v and low <0.3v with a 5v supply @ 200uA, the equivalent of a
~47k load. You should need no pullup on the ZX input pin but one
shouldn't affect the data, either.
I suspect something else is at fault.
Tom
Tom
Re: Eureka!
There is nothing wrong with using Register.PortD for its intended purpose. It just doesn't do what you need.drapal wrote:So what is wrong about using Register.PortD?
Each I/O port has 3 associated registers, e.g.
Code: Select all
Register.DDRA
Register.PORTA
Register.PINA
The second is the output latch. For each bit that is defined to be an output, the corresponding bit in Register.PortX specifies whether the output should be a zero or a one. For each bit that is defined to be an input, the corresponding bit in Register.PortX specifies whether the internal pullup resister should be enabled (1) or not (0). If you read Register.PortX, you get the value that was last written to it.
The third is the input register. Reading this register will give you the logic value that is present on each I/O pin of the port. Note, however, that this is only useful for bits that are defined to be inputs.
The GetPin() function first makes the pin an input (if it isn't already) and then gets the pin's value.
- Don Kinzer