CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Change pwm 18f4431

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jacob
Guest







Change pwm 18f4431
PostPosted: Sat Aug 08, 2009 6:19 am     Reply with quote

Hi...I wanna move PWM0,1 to PWM6,7.
I tried to change PWMCON0 (01010000) for enable all PWM.
It's still out at PWM0,1 ....... I have no idea how it work.
Code:

MOVLW    0x00
MOVWF    PTCON0

MOVLW    0xC0
MOVWF    PTCON1

MOVLW    0x20
MOVWF    PWMCON0

MOVLW    0x01
MOVWF    PWMCON1

MOVLW    0b00001110   
MOVWF    DTCON

CLRF     PTMRL
CLRF     PTMRH

MOVLW    0x00           
MOVWF    PTPERH

MOVLW    0xFF           
MOVWF    PTPERL

MOVLW    0xFF
MOVWF    OVDCOND

MOVLW    0x00
MOVWF    OVDCONS

Thanks a lot.....!!! Crying or Very sad
Ttelmah
Guest







PostPosted: Sat Aug 08, 2009 7:30 am     Reply with quote

You can't.....
Look at Fig17-1.
PWM 6/7, are the outputs for channel 3. You can't move the channel 0 outputs 'to' these.
You need to enable/use channel3, to get outputs on these pins.

Best Wishes
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Aug 08, 2009 10:59 am     Reply with quote

This post shows how to enable PWM on the six channels of the 18F4431:
http://www.ccsinfo.com/forum/viewtopic.php?t=37206&start=2

Also, this is a C forum for the CCS compiler. If you're programming
in MPASM, then you should ask your questions in the Microchip PWM
forum:
http://www.microchip.com/forums/tt.aspx?forumid=36

Or, in the Microchip 16-bit core (i.e., 18F PICs) forum:
http://www.microchip.com/forums/tt.aspx?forumid=7
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group