2

Author Topic: Looking for counter IC  (Read 1179 times)

0 Members and 1 Guest are viewing this topic.

Offline obiwanjacobiTopic starter

  • Full Member
  • ***
  • Posts: 57
  • Helpful? 0
  • You can PIC any micro controller - what AVR!
Looking for counter IC
« on: May 10, 2013, 04:00:28 AM »
I am building my first robot and its going great. It is a robot car kit with 4 cheap motors, a dual channel motor driver, an Arduino and a Ultrasonic sensor. I have the motors running and the wheel decoders are pulsing. I am now looking into interfacing with the sensor.

This sensor emits a pulse train when you request a measurement. The length of the pulse train corresponds to the distance of the detected object. The max pulse train length is 50 milliseconds.

I could write an ISR in the arduino that reads this pulse train and do it all in software. I could also add some hardware to unload this boring task from my Arduino.

I have looked into counter IC's. But I would like something that counts the pulses and can be interface with some sort of bus standard (I2C/SPI/CAN -  as simple as possible). I have not found a chip that can do that yet. A simple circuit is also fine - doesn't have to be all in one chip.

Anybody has some suggestions?

Thanx.

Offline billhowl

  • Supreme Robot
  • *****
  • Posts: 375
  • Helpful? 32
  • Your success is in your hands.
Re: Looking for counter IC
« Reply #1 on: May 10, 2013, 04:55:35 AM »
The counter IC SN74LV8154N has two 16-bit counters (you can stack them if wanted) and a single 8-bit output port , requiring only one shift register like 74HC589 to read as serial with SPI, you need 3 pins for it and 4 pins to control the counter mux.  Through-hole or SMT are both available.

You could of course use a small processor like the ATtiny85 as a counter and get the data via SPI.

Offline obiwanjacobiTopic starter

  • Full Member
  • ***
  • Posts: 57
  • Helpful? 0
  • You can PIC any micro controller - what AVR!
Re: Looking for counter IC
« Reply #2 on: May 10, 2013, 08:52:52 AM »
Ooh! That's a nice one! Thanx! Excellent < 1 dollar solution.  :P

Yes, I am also considering using ATtiny's (or similar) but I am just beginning with robotics and want to start of simple and want to build up to autonomous modules that talk to each other on a bus.

Offline jwatte

  • Supreme Robot
  • *****
  • Posts: 1,343
  • Helpful? 81
Re: Looking for counter IC
« Reply #3 on: May 10, 2013, 11:42:20 AM »
My suggestion is also to go with a Tiny85. It can talk SPI or I2C and it can count pulses and it can run with zero supporting circuitry (although a de-coupling capacitor doesn't hurt.)

Edit: I looked at the sensor specs, and that sensor has a TTL UART. Just speak serial to it!
« Last Edit: May 10, 2013, 11:44:01 AM by jwatte »

Offline obiwanjacobiTopic starter

  • Full Member
  • ***
  • Posts: 57
  • Helpful? 0
  • You can PIC any micro controller - what AVR!
Re: Looking for counter IC
« Reply #4 on: May 10, 2013, 12:15:14 PM »
Edit: I looked at the sensor specs, and that sensor has a TTL UART. Just speak serial to it!

 :-[ Oops

 ::) RTFM

I just looked at the sample code for mode 3...

Sorry, to waste your time guys. My bad.

Anyway, good to hear support for using ATtiny's...  ;D

 


Get Your Ad Here