johnnyquest
New Member
Hi,
I wrote a program for a 16F628A that inputs a value selected by a 3x4 keypad and display the value on three seven segment leds with the internal oscillator set @ 4MHz. I have a compare routine that limits the input from 0-256. I have the leds displayed in a loop and an interrupt for keypresses. This is tested and works great. My question is about taking the number value that is less that d'256' that is saved in a variable and using a 60Hz AC clock and putting the output on a pin for that many cycles when a button is pressed. Which timer input could I use? I am somewhat confused on how to do this, I have looked at Microchip appnote but there is no code to follow as an example.
This is an example of what I would like to do. I input the number 160 I would like to press a button and get 160 line pulses out.
I have extensivly searched the web to no avail. Any guidance or direction would be most appreciated.
Many Thanks,
JohnnyQuest
I wrote a program for a 16F628A that inputs a value selected by a 3x4 keypad and display the value on three seven segment leds with the internal oscillator set @ 4MHz. I have a compare routine that limits the input from 0-256. I have the leds displayed in a loop and an interrupt for keypresses. This is tested and works great. My question is about taking the number value that is less that d'256' that is saved in a variable and using a 60Hz AC clock and putting the output on a pin for that many cycles when a button is pressed. Which timer input could I use? I am somewhat confused on how to do this, I have looked at Microchip appnote but there is no code to follow as an example.
This is an example of what I would like to do. I input the number 160 I would like to press a button and get 160 line pulses out.
I have extensivly searched the web to no avail. Any guidance or direction would be most appreciated.
Many Thanks,
JohnnyQuest