Interrupt in zx24 question

Discussion about the ZBasic language including the System Library. If you're not sure where to post your message, do it here. However, do not make test posts here; that's the purpose of the Sandbox.
Post Reply
hakha4
Posts: 47
Joined: 01 June 2009, 21:23 PM
Location: Moholm Sweden

Interrupt in zx24 question

Post by hakha4 »

Hi
I want to use interrupt with zx24 and the manual says 'Port A Bit 2 must be an input for this to work properly' . It's kind og elemantory but I can't figure out how,I've tried Call Putpin(pin18, zxInputPullUp) but I'm unsure if it works, Any help would be appreciated
Regards Hucke
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: Interrupt in zx24 question

Post by dkinzer »

hakha4 wrote:It's kind og elemantory but I can't figure out how [to make a pin an input]. I've tried Call Putpin(pin18, zxInputPullUp)[...]
That will definitely make A.2 an input but it will also enable the internal pullup resistor. Depending on the external circuitry, that may OK or not. To make A.2 an input without the pullup, use:

Code: Select all

Call Putpin(A.2, zxInputTriState)
The mode values for PutPin() are all described in the ZBasic System Library Reference Manual.

As a side note, all general purpose I/O pins are set to be inputs (with no pullup resistor) at startup. It doesn't hurt, however, to explicitly configure the I/O pins as you want them using PutPin().
- Don Kinzer
hakha4
Posts: 47
Joined: 01 June 2009, 21:23 PM
Location: Moholm Sweden

Post by hakha4 »

Thanks!
stevech
Posts: 715
Joined: 22 February 2006, 20:56 PM

Post by stevech »

don't overlook an AVR newbie common mistake: check difference between the PIN input register and the PORT input register.
Post Reply