I found this in the c:\pbp3\readme.txt file:
Release Notes:
-------------------------------------3.0.5--------------------------------------
Fixed BLOCK_SIZE for 16(L)F1826/1827
Fixed configuration defaults for 12(L)F752 to match MPASM 5.44
Legacy SFR names restored for many devices
New Parts: 12F1501, 16F1503, 16F1508, 16F1509, 16F1512, 16F1513
... so I'm assuming that means I have 3.0.5 (I only bought the PBP3 upgrade last month).
I'll be using HPWM with a motor, but right now I just want to see it working with an LED. I've tried using CCP1 (which is an EECP) and CCP3, but no luck; the LED is just dimly lit no matter what Duty Cycle I use:
Code:
DEFINE OSC 20 ' Set oscillator 20Mhz
' ***************************************************************
' Device Fuses
' ***************************************************************
' PIC chip data sheets can be found here: C:\Program Files\Microchip\MPASM Suite
#CONFIG
__config _CONFIG1, _FOSC_HS & _WDTE_ON & _PWRTE_ON & _MCLRE_OFF & _CP_OFF & _CPD_OFF
__config _CONFIG2, _LVP_OFF
#ENDCONFIG
DEFINE CCP3_REG PORTA
DEFINE CCP3_BIT 2
ANSELA = %00000000 ' Digital only (PortA)
ANSELC = %00000000 ' Digital only (PortC)
ADCON1 = $0F
TRISA = %00000000 ' Make all pins on PortA output
TRISC = %00000000 ' Make all pins on PortC output
DUTY3 var word
' Set CCP modules to PWM mode
CCP3CON = %00001100 ' Mode select = PWM
PR2 = $FF '255
T2CON = %00000110 ' TMR2 on 1:!6 prescale
DUTY3 = 512
CCP3CON.4 = DUTY3.0
CCP3CON.5 = DUTY3.1
CCPR3L = DUTY3 >> 2
lblLoop:
goto lblLoop
end
(note that I used the example from the link above, but I'd really like to just use HPWM as my interrupt routine is going to modify the motor's speed via the HPWM duty cycle and that worked really well with the 16F628A)
Bookmarks