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
Connecting items to Port C pins

 
Post new topic   Reply to topic    Forum Index -> ZX-24
Author Message
victorf



Joined: 01 Jan 2006
Posts: 342
Location: Schenectady, New York

Posted: 02 January 2006, 21:27 PM    Post subject: Connecting items to Port C pins Reply with quote

I am going to use a ZX-24 to replace a much older controller in an app. I have been reading the docs and understand how to do most of what needs to be done to make the change. I do have a question or two regarding interfacing items to Port C. I wish to attach a piezo-buzzer (BZ) to one pin and a couple of switches (SPST) to other pins. The BZ is currently interfaced to the other controller with an NPN transistor as follows:

+5Volts to + side of BZ. BZ minus to collector of transistor. Emitter is grounded and the base goes directly to the pin. BZ buzzes when pin is low.

Should the BZ be connected to the ZX the same way?

Switches are currently connected thusly:
+5Volts to resistor (10k) to one pole of switch. this pole is also conneted to the pin of the ZX. Other side of switch to Gnd giving 1 on pin when SW is open and 0 when closed.

Should the switches be connected the same way? How should I configure the pins?

Any enlightenment will be appreciated.


Vic
Back to top
dkinzer
Site Admin


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

Posted: 03 January 2006, 0:03 AM    Post subject: Reply with quote

Quote:
+5Volts to + side of BZ. BZ minus to collector of transistor. Emitter is grounded and the base goes directly to the pin. BZ buzzes when pin is low.


Since the base-emitter junction is electrically similar to a diode, this isn't a suitable circuit. (I would posit that it wasn't correct for the previous system either.) You need a resistor from the I/O pin to the base and then the transistor will turn on and the buzzer will buzz when you output a 1 to the pin. The resistance to use depends on the transistor and the current that flows through buzzer when connected directly between 5 volts and ground. I would guess, however, that 1K would be fine; 10K might work, too.

If you want the buzzer to be active when the output is low you need a different circuit.

Quote:
+5Volts to resistor (10k) to one pole of switch. this pole is also conneted to the pin of the ZX. Other side of switch to Gnd giving 1 on pin when SW is open and 0 when closed.


That is the way that I prefer to connect switches. If you configure the pins to be inputs with the pullup active the external resistor is no longer needed.
Back to top
victorf



Joined: 01 Jan 2006
Posts: 342
Location: Schenectady, New York

Posted: 03 January 2006, 11:39 AM    Post subject: RE:Connecting items to Port C pins Reply with quote

Don,

Thanks for your reply. You are correct about the BZ connection. Im my current app it DOES have a 10K resistor from the base to the pin. I just stupidly left it off the discussion. My "old" brain sometimes forgets the details. I should have looked at the schematic before inquiring. Embarassed

Vic
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZX-24 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