CCPTMRS = %00000110 doesn't throw a compiler error; and this register does not exist on the PIC16F1828 data sheet nor in the Errata.
(maybe it's a mistake where CCPTMRS0 should be CCPTMRS in the data sheet) ?
..trial and error...
CCPTMRS = %00000110 doesn't throw a compiler error; and this register does not exist on the PIC16F1828 data sheet nor in the Errata.
(maybe it's a mistake where CCPTMRS0 should be CCPTMRS in the data sheet) ?
..trial and error...
-ray
"Imagination is more important than knowledge", Albert.E.
This error was fixed in PBP 3.0.0.0 (Aug 2011)
There is no patch for 2.60, but you can set the CCP registers directly instead of using HPWM.
Last edited by Darrel Taylor; - 20th December 2013 at 15:40.
DT
I am not using the PBP HPWM call, I am setting up the CCPs in PWM mode manually in the order the PIC16F1828 datasheet states,
I tried this code:
OSCCON = %11101000 '4Mhz intosc
Define OSC 4 'software timers indicated for 4mhz operation
TRISA = %00011011'Tris register 1=input(PORdefault) 0=output
TRISB = %00110000'No Vref's used on ADC
TRISC = %10000111
ANSELA = %00010011'Ansel register 1=analog 0=digital
ANSELB = %00010000
ANSELC = %10000111
CCPTMRS0 = %00000110'Timer2/4/6 assignment to CCP modules(pulsed output pins)
'
Start:
TRISC.3=1 'Disable pin output, set as input
PR4=200 'Set Period Rate, PRx, in Timer
CCP2CON=%00001111 'Turn on PWM
CCP2CON.5=1 'high bit of 2LSBs of Duty
CCP2CON.4=0 'low bit of 2LSBs of Duty
CCPR2L=180 '8MSBs of Duty
PIR3.1=0 'clear Timer interrupt flag
T4CON.1=1 'high bit of 2bit Timer Prescaler
T4CON.0=1 'low bit of 2bit Timer Prescaler
T4CON.2=1 'Timer On
TRISC.3=0 'Enable pin output
the compiler throws this error:
Error[113] c:\pbp\pbppi14e.lib 583: Symbol not previously defined (CCPTMRS0)
Error[113] c:\pbp\pbppi14e.lib 918: Symbol not previously defined (CCPTMRS0)
-ray
"Imagination is more important than knowledge", Albert.E.
MOVE?CB 006h, CCPTMRS0
is put into the .asm file eventhough the error is shown in Microcode Studio
(I don't even know why I'm telling you this, but I figured it may help)
-ray
"Imagination is more important than knowledge", Albert.E.
Can you please give me some code to use for loading a value into CCPTMRS0 manually on the PIC16F1828.
The data sheet shows its in memory map location:
Bank5
29Eh
CCPTMRS0
Thanks in Advance!... And I'm working on purchasing PBP3.0 as well.
-ray
"Imagination is more important than knowledge", Albert.E.
Hi,
I'm not sure this is the case but I think it might be an MPASM include file issue.
It looks like CCPTMRS and CCPTMRS0 registers are one and the same (they are defined that way (at 0x029E) in my version (5.47) of the MPASM .inc file) so it's possible that your version of the .inc file is missing the CCPTMRS0 regsiter definition.
So, try using CCPTMRS instead of CCPTMRS0 or you can try adding......at the very beginning of your code.Code:ASM CCPTMRS0 EQU H'029E' ENDASM
/Henrik.
DT is correct, after trying several variants of ASM code that didn't work; I was buying and downloading the PBP3.0.
The PBP3.0 is nicely packaged! Download the 128Mb flavor with all the new MPASM/Microcode Studio stuff...and you may need to get the latest Beta programmer software for newer PICs.
The multiple hardware PWMs on the PIC work from the multiple Timer2's now that I used PBP3.0
$$ well spent, and for a good cause to keep the PB biz going!
I still have a problem with keeping the hardware PWM going, it stops when I use HSER or ADC on other pins, eventhough the hardware PWM is coming out of a default ccp pin(that is not eusart by default)
..I haven't figured it out yet..
thanks all !!![]()
-ray
"Imagination is more important than knowledge", Albert.E.
Ok, the hardest problems are the one's when you are the problem yourself.
I had an error in a supporting device's code, fixed it, and now all works good.
BUT,
It would not be possible without using the PBP3.0
thanks DT !
-ray
"Imagination is more important than knowledge", Albert.E.
Bookmarks