Hippogriff
Member
Hi all,
I believe that I have need for a variable resistor in my project, to allow the user to change some desired function timing. But, for this question, let's assume I would simply like to increase or decrease the frequency of an LED flash that I have connected to an output pin of my PIC16F628A.
At first, I thought that I would be using A to D conversion via JAL, obviously - upon a read of the 628A datasheet, it lacks A to D capabilities! If I wanted to use A to D, seems that I'd need another PIC. That might still be the solution, but I do like using the 628A as I'm becoming more familiar with it (slowly).
Does anyone have any hints for me on how I might set one of the 628A's pins to be an input, then connect a variable resistor / potentiometer to it and somehow get that data into my JAL program so the byte variable then can change from, say, 0 to 255 (that range would be ideal obviously ) depending on how my user alters the dial... so that I can then use that figure to control my output flash frequency?
Sounds conceptually simple, doesn't it?, but I bet - somehow - it really isn't. Any hints and tips appreciated. Apologies if this is too simple, but this is a new component for me - I've just done output so far.
I believe that I have need for a variable resistor in my project, to allow the user to change some desired function timing. But, for this question, let's assume I would simply like to increase or decrease the frequency of an LED flash that I have connected to an output pin of my PIC16F628A.
At first, I thought that I would be using A to D conversion via JAL, obviously - upon a read of the 628A datasheet, it lacks A to D capabilities! If I wanted to use A to D, seems that I'd need another PIC. That might still be the solution, but I do like using the 628A as I'm becoming more familiar with it (slowly).
Does anyone have any hints for me on how I might set one of the 628A's pins to be an input, then connect a variable resistor / potentiometer to it and somehow get that data into my JAL program so the byte variable then can change from, say, 0 to 255 (that range would be ideal obviously ) depending on how my user alters the dial... so that I can then use that figure to control my output flash frequency?
Sounds conceptually simple, doesn't it?, but I bet - somehow - it really isn't. Any hints and tips appreciated. Apologies if this is too simple, but this is a new component for me - I've just done output so far.
Last edited: