Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 parallelput and parallelget on same port at same time?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
imseakin




PostPosted: Wed Apr 16, 2014 10:14 am   Post subject: parallelput and parallelget on same port at same time?

I'm building a slot car race management system for a course ISU.

I've built light-detectors that register when a car passes over a spot on a track.

I have built a track power circuit that controls the power going to the track via the parallel port using parallelput commands. No problem. Works fine.

I'd like to use 4 data wires on the same port (data wires 10,11,12,13) for the light detectors.

Right now I'm using data wires 2 and 3 (bits 1 and 2) for the power relays.
Or
Do I NEED to use wire 2 (bit 1) to 'power' the data bits (10,11,12,13) for parallelget statements? Or could I use data bit 3 for power (wire 3)? Or do I even need to power the 'get' data ports at all? Do they receive a data pulse as long as I've got pin 23 grounded to one side of the light detector switch?

In other words, can one set of data bits do 'puts' and the other set do 'gets' in the same program at the same time?

Any confirmations/suggestions would be appreciated.

thanks.

High School Comp Sci teacher
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Wed Apr 16, 2014 12:59 pm   Post subject: Re: parallelput and parallelget on same port at same time?

imseakin @ Wed Apr 16, 2014 10:14 am wrote:
In other words, can one set of data bits do 'puts' and the other set do 'gets' in the same program at the same time?

Good question. The documentation - parallelput - suggests that the command is non-blocking. That is, it sets the out pins as high/low, and moves on to execute the next line of code. Nothing in the documentation says as to how long the pins stay set. Plausible that they keep their state until the next parallelput.

So your question can be restated as: "will parallelget also reset the state of the out pins to some default?". If not, then it sounds like you can just use both. If it does reset the states, then the followup questions are "how fast can parallelget read?" and "is that amount of downtime acceptable?".
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: