×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

4-bit binary counters
2

4-bit binary counters

4-bit binary counters

(OP)
This is embarressingly basic, but my brain is fried from going round in circles.

I have a set of wall sensors that all have individual binary codes that need addressed to step through each module and request the state of all the sensors on each module. The information is sent back to a computer where the info is displayed.

I`m trying to find a simple to implement (preferably hardware, but by software if necessary) a count through from 0 to 16 and loop which will deal with the sensors, but if possible to take take each pulse and use it to increment the program to cycle through each wall module on the computer, ie when the wall module addressing increments from, say, 11 to 12, the computer will increment the "data page" from 11 to 12 as well so the info being fed back is shown in the right place.

ATM, I`m looking at a 2-part binary counter with a separate crystal oscillator. Does anyone have any ideas on all-in-one packages that are cheap and easy to work with?

Any more info ya need, just ask :)

Thanks a lot,

Kenny

RE: 4-bit binary counters

I think that you say that your sensors have individual codes and that you need to poll them from a computer, using one code at a time. Right? This surely means that you have to write some kind of a program to do just that. Creating a loop with a counter going from 0 to 15, using loop index for the address (perhaps via a table) and then starting from zero again seems to be the simple solution. What is the problem?

Gunnar Englund
www.gke.org

RE: 4-bit binary counters

(OP)
Thats the "easiest" way to do it, I agree. I`ve been asked to avoid a microcontroller if possible, and I`m not the worlds greatest programmer  :D At the moment, using a microcontroller looks inevitable from the way I`m seeing it, but I`m open to alternative ideas :)

Thanks!

Kenny

RE: 4-bit binary counters

The computer that is showing the data "in the right place", should also be fully capable of banging bits to talk to the modules.

Hint: A PC's parallel port can be made to do almost anything.

RE: 4-bit binary counters

OK, a piece of hardware that otputs a set of four bits increasing from 0 to 15? The good old binary counter 74xx93 does just that. There are also counters in other logic families. But the 74HCT93 is available and cheap. For the timing, I would use a simple RC oscilator based on a 74HCT14 and a capacitor/resistor.

Gunnar Englund
www.gke.org

RE: 4-bit binary counters

It seems to me that:
1.) you want to read 16 sensors, perhaps with individual
   calibration factors, process the data, display,
   perhaps store and perform some kind of statistics
   and other operations.
2.) I don't think it is reasonable to do it with pure
  hardware --you need some computer.
3.) Around 70 bucks you can get PC compatible business
card size computer which I would program in some
BASIC.
4.) Can you build the interface logic ?
==================================================
To give some real help, we need more data:
1.) Sensors make and type#
2.) a simple pseudo-program e.g.

; temp : integer array of 16  
10 times
{ for address = 0 to 15
 { output adress
  input t
   add t to temp( address) }
}
divide the temp array by 10
display temp array (Format ??)
reset temp array

etc.
Or at least a very good description of what do
you want to do with the sensor readings ?

 

<nbucska@pc33peripherals.com> omit 33 Use subj: ENG-TIPS
Plesae read FAQ240-1032

RE: 4-bit binary counters

(OP)
Hi! Thanks for the replies!

The door sensors are very basic- sending a "1" or a "0" depending on the state of the sensors. No calibration, but storage and display are needed. To be able to take the data and use it in statistics, graphs etc would be nice, but is considered a luxery and not expected of what i`ve been asked. I was thinking af avoiding 0000 and 1111 as sensor readings for power-on reset and keeping 1111 just in case so 14 actual wall modules- omitting 0000 and 1111 from the cycle doesnt matter- there just wont be any wall modules with those codes.

I`ve yet to really get into the programming so cant knock together a demo code yet, sorry.

I had a quick play with the 74HC161 earlier today, but no crystal kicking around to use with it straight away unfortunately :( A bit of wire connected to the 5V rail should do though, right?

:)

Kenny

RE: 4-bit binary counters

KennyC:
Please read the )(&*^%&(&&% FAQ !!!
and then why don't you just tell us, what are you trying to do.

It may be simpler to design the circuit than finding out
what you want.

<nbucska@pc33peripherals.com> omit 33 Use subj: ENG-TIPS
Plesae read FAQ240-1032

RE: 4-bit binary counters

Exactly! Star for you.

Gunnar Englund
www.gke.org

RE: 4-bit binary counters

"...simpler to design the circuit than finding out what you want."

'Situation normal' for most projects. Deep inside every huge project is a ten minute design exercise.

RE: 4-bit binary counters

Using a free running hardware counter to increment the polling address is fraught with danger, because any number of circumstances can cause the computer's internal index that should correspond to the counter's polling address to get out of synch with the hardware counter.  WHEN this happens, the data coming into the computer goes into the wrong bin, and becomes the wrong data.

Remember, with a free running counter, the computer doesn't know when the counter is being incremented, so it's easy for the computer to read the data from sensor N+1 when the computer thinks it's looking at sensor N.  

This can happen despite the presence of command pulses sent from computer to counter, index pulses sent from counter to computer, or even complicated handshake sequences between the two devices, because the computer's response time, thanks to Windoze, is not known, predictable, or limited.

BETTER that the computer should generate the binary address internally, use the exact same storage location as the index for the storage array, and send out the polling address as it is needed, when it is needed, using the simplest, dumbest possible hardware.

This has the further advantage that the sensors can be polled in any order, and the frequency of polling may be individually adjusted as needs change.

  

Mike Halloran
Pembroke Pines, FL, USA

RE: 4-bit binary counters

Mike has a very good point!

RE: 4-bit binary counters

Yes, and anything else would be just foolish. I must admit that I thought there was some thinking behind the OP - but I could not make out what it was.

Gunnar Englund
www.gke.org

RE: 4-bit binary counters

I speak from experience here.  I have been associated with several projects where the electronics engineers implemented auto- incremented addressing in multipoint data acquisition boards, because they could do it, and it sounded cool, and "it made the programmers' job easier".

Of course, the odd cosmic ray would auto- increment the address when it wasn't supposed to increment, or transients would make an increment pulse disappear, and pretty soon the programmer would be tasked with figuring out which  channel had actually been read, using hardware that was smart enough to get in the way, not smart enough to check itself, and not dumb enough to work right.

As a former Professional Programmer (when that didn't mean Web Developer) and Hacker (when that was a good thing), I hate 'smart' hardware.  And 'high level' and 'third generation' languages, but that's a different discussion.

Mike Halloran
Pembroke Pines, FL, USA

RE: 4-bit binary counters

Star 2 Mike for being right.

In the 80-s I worked for a start-up. We had one PDP-11 with
30 terminals for engineering, inventory,payroll etc.
The two 10 Mb disk was enough for more than two years.

We had less/no bells and whistles but no virus, spam,
and seldom any bug.

My productivity as user/programmer/designer was higher.

<nbucska@pc33peripherals.com> omit 33 Use subj: ENG-TIPS
Plesae read FAQ240-1032

RE: 4-bit binary counters

Ah yes so did we.  Was the size of two refrigerators.  Ours was so old it had "core" memory and we had to manaully, (using toggle switches), set in the first five instructions to boot the system.

It always worked.infinity
 
Keith Cress
Flamin Systems, Inc.- http://www.flaminsystems.com - kcress@<solve this puzzle>

RE: 4-bit binary counters

Well, I know some places till use PDO-11 e.g. for trafic light or process control...

<nbucska@pc33peripherals.com> omit 33 Use subj: ENG-TIPS
Plesae read FAQ240-1032

RE: 4-bit binary counters

Aah. The PDP-11 AND the PDP-8E.

Loved the colour of those toggle switches. Pinkish/violetish on the -11 and yellowish/brownish on the -8E. If I remember right.

Gunnar Englund
www.gke.org

RE: 4-bit binary counters

heheh...
Ours was a gorgeous burnt orange with white switches.  I think the disk (15inch?) was 5MB.

Keith Cress
Flamin Systems, Inc.- http://www.flaminsystems.com - kcress@<solve this puzzle>

RE: 4-bit binary counters

5 MB!!

You were lucky, you.

Gunnar Englund
www.gke.org

RE: 4-bit binary counters

skogs; I could be wrong on that detail..
Here's what ours looked like:

Even with paper notes stuck on it to list those first few instructions in binary!

http://www.pdp8.net/pdp8i/pics/pdp8i_frontpanel.shtml?med

Those were the days..  Amazing really, to realize how far we've come in computing in just a few years.  

Keith Cress
Flamin Systems, Inc.- http://www.flaminsystems.com - kcress@<solve this puzzle>

RE: 4-bit binary counters

We had a General Automation GA16-220 as a departmental computer.

Aside from disk head crashes due to building work (dust is not kind to hard disks...) it went wrong twice in 8 years: once when the dma card died & once when a zonky 40A diode in the linear psu went s/c coz its mounting nut had come loose.

I'll never forget the smoke from the psu when that happened...

Test equipment ran on GA SPC16 computers with core memory.

As you say, no viruses, no GUI, and green screens that didn't hurt your eyes.

RE: 4-bit binary counters

LSI-11 with DUAL 5MB removables, yeah baby!!!!

TTFN



RE: 4-bit binary counters

Oh, sexy, sexy!

Gunnar Englund
www.gke.org

RE: 4-bit binary counters

I think yous guys scared off the OP :)

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"It's the questions that drive us"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

RE: 4-bit binary counters

Yeah.

Proper hard disk drives that took two people to mount into a 19inch rack... 5Mb cartridge & 5Mb fixed platter...

RE: 4-bit binary counters

Worse yet, A-kid2D-man. We scare ourselves.

Gunnar Englund
www.gke.org

RE: 4-bit binary counters

Zeit, you brought up a point.  I could stare at a green screen for upwards of 24 hours at a time.  I can deal with a CRT for 8.  This flat screen wears me out in two.

Is it just me?

Mike Halloran
Pembroke Pines, FL, USA

RE: 4-bit binary counters

Green screens weren't that bright, since they were displaying against dark background.

TTFN



RE: 4-bit binary counters

Green is also good for your eyes. I feel the same. Thought perhaps that age played a role, too?

The old DOS screens were dark, with greyish text. Sometimes amber or green. Remember doing around-the-clock work with no problems.

We may be on to something. A new trend. "NOSOREYES"(TM) screens?

Gunnar Englund
www.gke.org

RE: 4-bit binary counters

And the characters were crisp & clear & well defined.

In my collection of valuable artifacts (i.e. junk) I have a PC-XT with a mono screen.

Once in a blue moon I turn it on & am always amazed at how wonderfully clear the text on the screen appears.

RE: 4-bit binary counters

Also, the screens were so dim that you had to use them in a darker environment.  I remember the old Tek 4014 vector display we used for graphing outputs from SUPREM and and other simulation programs that needed to be a darkened room to see anything useful.  All that reduced the strain on the eyes.  Of course, we all then looked like mole people when we left work and entered normal lighting winky smile

TTFN



RE: 4-bit binary counters

Dang! Actually seems like these first terminals were a step backwards from the first thing I used.  They worked well.  



Keith Cress
Flamin Systems, Inc.- http://www.flaminsystems.com - kcress@<solve this puzzle>

RE: 4-bit binary counters

Yes, and at 10 chars/second, you could read as it typed away. I am not at all that fast these days...

Gunnar Englund
www.gke.org

RE: 4-bit binary counters

Ah yes. The joy of producing paper tape source for your FORTRAN IV program... then stepping on it & ripping it to shreds... lucky they made those sticky plastic patch things.

RE: 4-bit binary counters

Those cool yellow rolls with rubber bands on them.

I ran basic on them.

Oh oh!! And playing Star Trek on them.. You'd do a sector scan and it would print out radial sectors.. Then you'd do some trig and put in an angle.  Launch photon torpedoes.  Bingo!  Of course that was between the Least Squares curve fitting you were doing...


Keith Cress
Flamin Systems, Inc.- <http://www.flaminsystems.com> - kcress@<solve this puzzle>

RE: 4-bit binary counters

(OP)
Thanks MikeHalloran :D

I didnt think about that aspect, so when i`m done and being asked/interrogated about my design choices I can mention that :D

RE: 4-bit binary counters

Don't forget to mention the ASR33 teletype & FORTRAN IV too.

People are very impressed by that... clown

RE: 4-bit binary counters

I have fond memories of the old Brush strip chart records produced by the 100 Volt Beckman Ease, but I don't miss the sore fingers associated with plugging up a big patch panel.  Problem solutions always seemed more tangible in the analog lab then they do now with systems like Simulink.

Anybody remember the old curb feelers on cars?

RE: 4-bit binary counters

Systron-Donner analogue computers! And Philbrick dual-tube amplifiers! Anyone impressed?

Gunnar Englund
www.gke.org

RE: 4-bit binary counters

um... now you're losin me... blush Guess this is dating me.pacman

Keith Cress
Flamin Systems, Inc.- <http://www.flaminsystems.com> - kcress@<solve this puzzle>

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources