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 CCS Technical Support

PWM

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



Joined: 02 Oct 2004
Posts: 22
Location: cleveland

View user's profile Send private message Send e-mail

PWM
PostPosted: Sat Apr 08, 2006 6:45 am     Reply with quote

Hello,
I was wondering if anybody had a link to better explanation of using the compare module to output a PWM string of pulses for communication.
microchips AN594 tries to explain it but the code is ASM and its not my strong suit. I'm really on the hunt for something similar written in C.

Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Apr 08, 2006 12:44 pm     Reply with quote

These CCS driver and example files have C source code that uses the
PWM module in Compare mode:

c:\Program Files\PICC\Examples\EX_CCP1S.C
c:\Program Files\PICC\Drivers\SERVOS.C
c:\Program Files\PICC\Drivers\EM4095.C
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Sat Apr 08, 2006 5:04 pm     Reply with quote

What sort of communication are you trying to do with the PWM? It is usually used for analog output or power control, not communication.
_________________
The search for better is endless. Instead simply find very good and get the job done.
dmendesf



Joined: 31 Dec 2005
Posts: 32

View user's profile Send private message

PostPosted: Sat Apr 08, 2006 8:32 pm     Reply with quote

I donīt know what heīs doing, but iīve used the PWM for generating a diferential manchester signal. Itīs very easy and works OK.
eaton



Joined: 02 Oct 2004
Posts: 22
Location: cleveland

View user's profile Send private message Send e-mail

PostPosted: Mon Apr 10, 2006 8:56 am     Reply with quote

I'm trying to communicate to a car using the SAE J1850 PWM protocol.
each bit is 24us long. a 1 is high for 8us and low for 16us while a zero is high for 16us and low for 8us. This sounded like a job for a PWM signal.
33% for a 1 and 66% for a zero. But it's not working out.

any help would be appreciated
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