Maker Pro
Maker Pro

need help to write simple program

I am going to write to make speed meter
I use 7 segment display with display drivers
here is the circuit
using micro c for pic can you help me to do it.
I am really new to programming.
sp.jpg
 

KrisBlueNZ

Sadly passed away in 2015
If you're new to programming, this may not be a good project to start with. It contains a number of separate functional requirements: input capture and debounce, pulse counting, conversion of pulses to a rate, arithmetic scaling, conversion to numeric representation, and multiplexed display driving. You'll probably need some control button as well.

You may decide to use interrupts for input capture and for display update, and interrupts are a whole subject to themselves.

I suggest you start with a simple program to control an LED. Then progress to driving multiple seven-segment displays in a multiplexed arrangement (see http://www.google.com/search?q=multiplexed+7-segment+display+drive&tbm=isch). You may choose to drive the display using a timer interrupt, though this is not necessary. Then move to the input logic - debouncing may be needed, and you may choose to use an interrupt here as well, though again, that is not necessary.

Finally, you can progress to joining the two parts together. That would include arithmetic scaling, possibly using calibration factors stored in EEPROM, and conversion of pulse events to a rate value.

Each one of these stages represents a lot of learning for someone who is new to programming. If you're serious about this project, try some simpler projects first, then learn about multiplexed display drive. It is widely used and there are lots of example designs and code fragments that you can use.

We will be happy to help you, but you should get some programming experience, and then work on one operational function at a time.
 
Top