Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 19, 2024, 07:23:43 19:23


Login with username, password and session length


Pages: [1]
Print
Author Topic: Help dSPIC30F PWM  (Read 9837 times)
0 Members and 1 Guest are viewing this topic.
Kova
Junior Member
**
Offline Offline

Posts: 68

Thank You
-Given: 172
-Receive: 24



« on: February 05, 2008, 08:48:13 08:48 »

Hi all,
sorry for my english  Grin
I'm newbie of dSPIC30F  Shocked.

Always I have used CCS C Compiler for 8-bit MCU, but now I have tested the PCD Compiler and I have seen that there are too bugs and not all function have been implemented.
So, I have decided to use for the first time C30 C compiler  Grin
I have downloaded all documents, sheets, e-books but this compiler is a bit different from CCS and less intuitive Shocked

Can somebody upload some example for dSPIC and C30 Compiler?
On the net there aren't many sources  Cry
I'm searching especially for PWM sources  Cheesy

Thanks for all Wink
Bye
Logged
jezo
Newbie
*
Offline Offline

Posts: 27

Thank You
-Given: 37
-Receive: 13


« Reply #1 on: February 06, 2008, 06:56:01 18:56 »

Hi, PWM exapmle is directly in the MPLAB C30 examples directory - CE003_Sinusoidal_BLDC.


And few another complete examples (with MPLAB workspace) you can download from microchip page with demo boards:

Code:
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2519&param=en025319&page=wwwdsPICDSCDemo

But PWM there's not (I think)...
Logged
vovchik02
Junior Member
**
Offline Offline

Posts: 62

Thank You
-Given: 43
-Receive: 13



« Reply #2 on: February 07, 2008, 05:58:01 05:58 »

www.microchip.com AN0098 - AC Induction Motor 00984a.pdf have as part PWM exampl sourse.
Logged
30f4011
Active Member
***
Offline Offline

Posts: 131

Thank You
-Given: 753
-Receive: 96



« Reply #3 on: July 06, 2008, 01:57:22 13:57 »

Hi this is code for simple PWM operation:--
PR2=16582;//--->desired PWM period (calculated from eqn. given in datasheet)
OC1CON=0x06; /*configure the pwm channels according to operation*/
OC2CON=0x06;
OC3CON=0x06;
OC4CON=0x06;
T2CONbits.TON=1;//run the pwm timer (either timer2 or timer 3,inthis case timer 2)
T2CONbits.TCS=0;
OC1RS=pos1;//program each compare value
OC2RS=pos2;
OC3RS=pos3;
OC4RS=pos4;
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC