Windmiller
Member level 4
Hi!
I'm going to (try to) make a handheld wind measuring device in m/s unit integers only. Will code this in assembler.
I have the routine to convert hex to decimal so that I can display 0-99 on two 7-segment LCDs.
What I was thinking:
Using a PIC16F628 with the internal clock, and two 7-segment LCD dispalys.
Add an interrupt on one pin that will get external signal from a propeller rpm source switch, that only will increase a counter every time the switch is beeing switched (light switch).
Create a timer fast enough to display numbers >= 10 on the first LCD and then the <= 9 on the second, don't know what speed 8ms?? Add one counter in the timer loop that will call a new function every 1000ms / 1sec.
The 1sek function will measure the m/s by the knowledge of the 1 secound run and the number from the input switch counter, somehow. And reset the inerrupt counter for the next secound calculation.
But I don't know if this is the best way, or is there a better way of doing this?
If it is a good way, what values do I need to set the timer (16 bit TMR1L, TMR1H) and the prescaler to get my 8ms for the displays * 125 = 1000ms for the calculation function.
Someone who can help me, has been there already or just know how to do this? :?
I'm not asking for a complete solution, just hints on the way
Thanks in advice..
/ Morgan
I'm going to (try to) make a handheld wind measuring device in m/s unit integers only. Will code this in assembler.
I have the routine to convert hex to decimal so that I can display 0-99 on two 7-segment LCDs.
What I was thinking:
Using a PIC16F628 with the internal clock, and two 7-segment LCD dispalys.
Add an interrupt on one pin that will get external signal from a propeller rpm source switch, that only will increase a counter every time the switch is beeing switched (light switch).
Create a timer fast enough to display numbers >= 10 on the first LCD and then the <= 9 on the second, don't know what speed 8ms?? Add one counter in the timer loop that will call a new function every 1000ms / 1sec.
The 1sek function will measure the m/s by the knowledge of the 1 secound run and the number from the input switch counter, somehow. And reset the inerrupt counter for the next secound calculation.
But I don't know if this is the best way, or is there a better way of doing this?
If it is a good way, what values do I need to set the timer (16 bit TMR1L, TMR1H) and the prescaler to get my 8ms for the displays * 125 = 1000ms for the calculation function.
Someone who can help me, has been there already or just know how to do this? :?
I'm not asking for a complete solution, just hints on the way
Thanks in advice..
/ Morgan
Last edited: