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
Interrupt in zx24 question

 
Post new topic   Reply to topic    Forum Index -> ZBasic Language
Author Message
hakha4



Joined: 02 Jun 2009
Posts: 30
Location: Moholm Sweden

Posted: 09 September 2009, 18:40 PM    Post subject: Interrupt in zx24 question Reply with quote

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
Back to top
dkinzer
Site Admin


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

Posted: 09 September 2009, 19:36 PM    Post subject: Re: Interrupt in zx24 question Reply with quote

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:
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().
Back to top
hakha4



Joined: 02 Jun 2009
Posts: 30
Location: Moholm Sweden

Posted: 09 September 2009, 21:31 PM    Post subject: Reply with quote

Thanks!
Back to top
stevech



Joined: 23 Feb 2006
Posts: 657

Posted: 11 September 2009, 6:25 AM    Post subject: Reply with quote

don't overlook an AVR newbie common mistake: check difference between the PIN input register and the PORT input register.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZBasic Language 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