On Sunday 13 July 2008, [EMAIL PROTECTED] wrote:
> The code looks ok. I only have 18f2XXX devices here and there the pwm
> pins are on PORTC (TRISCbits.TRISC1 and TRISCbits.TRISC2) by default and
> the TMR2 is enabled with T2CONbits.TMR2ON = 1; In your code you used
> TMR2ON = 1, not sure if that works.
>
Thanks. I can't see that I am doing anything radically different to you.
I tried a number of option. TMR2ON = 1 does not cause and errors but
T2CONbits.TMR2ON is not defined in the header files for these chips.
//Timer 2 on
//TMR2ON = 1;
//T2CONbits.TMR2ON = 1;
T2CON = T2CON | 4;
Bar the one you suggested (not defined) all of the above seem to work. Not
completely sure TMR2 is running - unfortunately gpsim is segfaulting when I
try to view the ram - but that is a different issue that I've yet to try to
fix (and if I can't I need to bring that up elsewhere).
> According to the microchip ANs its a good habit to first clear the
> CCPxCON register to completely disable the CCP-Module before setting own
> stuff.
I added in the following at the start of the routine.
//Clear CCP1CON before programming.
CCP1CON = 0;
Unfortunately it did not seem to help.
>
> I use the following code to enable both pwm channels on my 18f2XXX devices:
Thanks,
maybe I'll have to look to see if I have any 18f2xxxx devices and see if I can
get your routine to work.
Pete
--
Peter Chant
http://www.petezilla.co.uk
-------------------------------------------------------------------------
Sponsored by: SourceForge.net Community Choice Awards: VOTE NOW!
Studies have shown that voting for your favorite open source project,
along with a healthy diet, reduces your potential for chronic lameness
and boredom. Vote Now at http://www.sourceforge.net/community/cca08
_______________________________________________
Sdcc-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sdcc-user