Go Down

Topic: INSTANT SPI 6-DIGIT 7-SEGMENT LCD FREQ COUNTER (Read 74 times) previous topic - next topic

raschemmel

Mar 08, 2015, 11:02 pm Last Edit: Mar 09, 2015, 03:12 am by raschemmel
I'm posting this here because I can't think of anywhere else to post it.
Basicly, if you buy one of 6-DIGIT 7-SEGMENT LCD DISPLAY

and load the attached frequency counter code,


MAKE NOTE OF THIS:
Code: [Select]
pinMode(CS, OUTPUT); //Pin 2
   pinMode(WR, OUTPUT); //Pin 3
   pinMode(DATA, OUTPUT); //Pin 4    


which is the wiring connection for the display[/b]
CS=D2
WR=D3
DATA=D4

AND THIS:

Code: [Select]
// Frequency counter Input: Pin D5


you will have literally , an instant Frequency counter with serial frequency output.
If you breadboard the ATmega328 following this, and you buy an ATmega328 with the OPTIBOOT BOOTLOADER (+ 16 Mhz xtal and qty:2  (18pf caps) )
from DIP MICRO ATmega328 /w OPTIBOOT BOOTLOADER you can build your own case for the counter.

Code , courtesy of NICK GAMMON from his Timer Tutorial HERE:, which I simply copied and pasted into the IDE
and added the code from the example code:

(attached)
Note the use of CAST:

Code: [Select]
t = (unsigned long int) frq; // now t is frq

By changing the value of the 2nd argument of displaydata() function, and inserting brief delays, I move the decimal point position from "1" to "3"
The last three arguments are the batt level indicator args which can be "0" for OFF or "1" for ON.
I also cycle these in the modified example program. The default example does not change the decimal point or the batt level indicators. If you create variables for them "bat1" "bat2, "bat3" you can read a
voltage divider and do some decision making to control the batt level indicator.

If you take the display out of the box and wire it up as instructed and load the sketch attached sketch it shouldn't take you longer than 10 minutes to have a working frequency counter
that accepts TTL level logic signals. If you want to go the extra mile and build a front end for it that converts non-TTL signals to arduino compatible signals that's up to you.

Enjoy !
Arduino UNOs, Pro-Minis, ATMega328, ATtiny85, LCDs, MCP4162, keypads,<br />DS18B20s,74c922,nRF24L01, RS232, SD card, RC fixed wing, quadcopter

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy