Go to Post At GLR our team only had to deal with a bunch on kids seeing snow for the first time. With all the ensuing snow fights and vainly trying to run up the giant snowy hill behind the arena. - Kevin Sevcik [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 02-02-2007, 09:03
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Kevin's PWM 13-16 Code in easyC PRO

Has some of you may or may not know easyC is currently
unable to control PWM's 13-16 due to the fact they
are tied to the user processor and cause problems
when used with interrupts. MPLAB users were able
to use these PWM's but sometimes had issues the
the ports generating "noisey" PWM signals.

Kevin Watson wrote some excellent code to fix this problem
and in doing so also made the outputs extreamly accurate.
He has a thread here: http://www.chiefdelphi.com/forums/sh...ad.php?t=51802

Due to some new features in easyC Pro we can also
take advantage of this code just like the MPLAB
users have been able to do.

Instructions:
1.) Download http://kevin.org/frc/frc_pwm.zip and
extract it to the directory of your choice.

2.) Click on the 'Project' tab

3.) Right click on 'Source Files'. Then click
'Add Existing Item' browse to the directory
you extracted the zip file and click on pwm.c
you should now see pwm.c on the tree.

4.) 3.) Right click on 'Header Files'. Then click
'Add Existing Item' browse to the directory
you extracted the zip file and click on pwm.h
you should now see pwm.c on the tree.

5.) In pwm.c replace #include "ifi_default.h"
with #include "p18cxxx.h"

6.) In UserInclude.h add #include "pwm.h"
under //add user code here

7.) In the initialize block drag in a 'USer Code'
block and call 'Initialize_PWM();'

8.)Then anywhere in your program just call
PWM(Unsigned Char PWM13,Unsigned Char PWM14,Unsigned Char PWM15,Unsigned Char PWM16);
to run the PWMs. Also make sure you have at least a 10ms wait in your code between calls so it doesn't update too fast.

If you have any questions just post.
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Download easyC PRO & 2007 Kickoff Code Kingofl337 Programming 1 24-01-2008 09:15
EasyC Pro trial? Stuart Programming 3 07-02-2007 22:33
Team THRUST - Kevin's Code and Camera Code Combine Chris_Elston Programming 3 31-01-2005 22:28


All times are GMT -5. The time now is 04:15.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi