question about a program in language C using pic18f4520

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
mhp
Posts: 2
Joined: Mon Sep 10, 2018 1:22 am
Contact:

question about a program in language C using pic18f4520

Post by mhp »

I need to create a c language program from pic18f4520 (mplab), the program is to create a rpm counter from 0-9999, can anyone tell me the steps I have to follow to make the program. if someone has the program ready, you can send me

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: question about a program in language C using pic18f4520

Post by Benj »

Hello and welcome to the forums.
can anyone tell me the steps I have to follow to make the program.
1) Learn C
2) Create the program

:wink:

What have you done so far, we won't write the program for you but we can likely help if you get stuck.

Also you don't explain how you are counting revs. I take it you receive some sort of digital pulse.

I would likely do something like this.

1) Use a timer to measure time
2) Count the number of pulses over a short period of time
3) Multiply up your counter so that the period of time now covers a minute to give you RPM

I have done something similar recently using an encoder, this gives a revolution pulse but also a 1440 pulse per rev count so that I can work out the direction of movement and RPM much more accurately without big multiplication errors.

Next is how you are going to output the count? Using a LCD? Using a series of 7-seg displays? Using comms?

mhp
Posts: 2
Joined: Mon Sep 10, 2018 1:22 am
Contact:

Re: question about a program in language C using pic18f4520

Post by mhp »

thanks for the help, I'll simulate the program in proteus using the 7 segment display

Post Reply