even more basically,
I want to send a 0.5us pulse every 40us.
I have this program below, nothing is coming out of it, althou if i remove the lineEFINE OSC 20, it works. How do i set my 20mhz ?
Below without the define 20, it gves me an oscillation of 125Khz
@ DEVICE PIC16F88, MCLR_ON,HS_OSC, WDT_ON, LVP_OFF, BOD_OFF, PWRT_ON, PROTECT_OFF, CCPMX_ON
INCLUDE "modedefs.bas"
DEFINE OSC 20 'use external 20mhz crystal
CMCON = 7 : ANSEL = 0 : ADCON1 = 7
DEFINE CCP1_REG PORTB 'Hpwm 1 pin port, RIGHT
DEFINE CCP1_BIT 3 'Hpwm 1 pin bit
TRISB = %00000000
PAUSE 1000 ' start-up delay
HPWM 1,3,25000
loop:
goto loop
end
oddly enough even if I change to lower values like:
HPWM 1,3,15000
it do not work
Bookmarks