They even stack the zeners, when charging the supercaps ..
so far i got a very small program , programmed and running on the 628..yay !! ya gotta remember its been months since i programmed a pic..
next step is to program the 16F88..i understand that the A/D converter is selected and available from the get go..?
this should be fun.. 8)
i cant find it .. but what i saw showed several layers of caps in parallel with zener diodes , to make sure that each caps voltage did not excede the 5.5 V maximum..
I got them ..
and tried two in parallel , with a NiMH cell below them ..
so i charged caps up to 5V then connected the cell , then connected that to a 100 ohms resistor , then connected diode ..
diode current started @ 13 mA and 4.5 mins. later current was 1.3 mA..
so it should last twenty mins. without blinking at all . but i still want to use PWM and the A/D converter of the PIC 16F88..
sadly i'm not getting anywhere with my PWM routine
i need help.. getting started..
i have been looking at the PDF for days !! :cry:
if i have a templet to go by , i can make changes as needed..
What i need is a 10 precent duty cycle PWM signal running at 100 HZ with a 5.068 Mhz clock on a 16F628..
thanks in advance
The next step is to set T2CON, this sets the frequency of the PWM, as it's derived from the 20MHz system clock it runs too at too high a frequency, there are two possibilities here - setting the prescaler divides the frequency before the PWM section, and the postscaler afterwards. For this example we set the prescaler to divide by 16, this gives us a PWM frequency of 2500Hz.
The next step is to set T2CON, this sets the frequency of the PWM, as it's derived from the 20MHz system clock it runs too at too high a frequency, there are two possibilities here - setting the prescaler divides the frequency before the PWM section, and the postscaler afterwards. For this example we set the prescaler to divide by 16, this gives us a PWM frequency of 2500Hz.
PWM Period = [(PR2) + 1] • 4 • Tosc • Prescale (see section 8.3.1 of the PIC16F87XA datasheet)
PWM Period = [124+1] * 4 * 0.05usec * 16
PWM Period = 400usec. for a 2500Hz frequency.
The correct PR2 value should be 124 not 126 to get 2500Hz.
Yes. PR2 is about equal to 9. However, if you set the PR2 to a very low value, the number of PWM duty cycle slices steps will be very low. In this case, it's just 36 slices (9*4).
Great !!
so my clock is 5,068,800 HZ divide that by 8..gives 633,600 Hz clock into PIC..
with a 1000 HZ PWM Freq.
and a prescale of 1..
gives
.001 = ((PR2+1) * 4) / 633600
PR2= 157
and my number of different steps is 633 .
that really helped , because i saw that equation but without your explaination it didnt sink in..
Great !!
so my clock is 5,068,800 HZ divide that by 8..gives 633,600 Hz clock into PIC..
with a 1000 HZ PWM Freq.
and a prescale of 1..
gives
.001 = ((PR2+1) * 4) / 633600
PR2= 157
and my number of different steps is 633 .
that really helped , because i saw that equation but without your explaination it didnt sink in..
I suggest you try reading my tutorial, which makes thinks a little clearer - PR2 basically sets the number of steps, but the tutorial gives the simple sequence of steps that I used.
Great !!
so my clock is 5,068,800 HZ divide that by 8..gives 633,600 Hz clock into PIC..
with a 1000 HZ PWM Freq.
and a prescale of 1..
gives
.001 = ((PR2+1) * 4) / 633600
PR2= 157
and my number of different steps is 633 .
that really helped , because i saw that equation but without your explaination it didnt sink in..
I suggest you try reading my tutorial, which makes thinks a little clearer - PR2 basically sets the number of steps, but the tutorial gives the simple sequence of steps that I used.