2 Replies - 2049 Views - Last Post: 18 September 2011 - 02:10 PM Rate Topic: -----

#1 willist  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 38
  • Joined: 11-April 10

dsPIC33F and PWM signals

Posted 14 September 2011 - 06:02 PM

Greetings,

I am having some issues with programming a dsPIC33FJ32MC302. The link for the data sheet is: http://ww1.microchip...eDoc/70291F.pdf

Two programmers before me created four library files for the dsPIC33. The four files are dsPIC33F_init.c, dsPIC33F_input.c, dsPIC33F_output.c, and dsPIC33F_support.c. These files perform various functions including initializing pins, setting up functions, defining inputs/outputs and various other things. Along with this there is a file called krisys_driver.c. This file creates the pwm arguments, testing functions and a bunch of other stuff. It was set up to have two PWM signals and two direction signals. The dsPIC33F can support 4 PWM signals. The file that I have created is called gsmp_driver.c. It creates 4 PWM signals using the 4 PWM outputs from the PIC and then it uses 4 D I/O's as direction signals. I have begun testing the code and my direction signals are working because I hooked them up to LED's and verified that they are working. I cannot, however, get my PWM signals to work. I have made sure that I have initialized everything and I have double checked for errors. I am completely stuck. Any help would be appreciated. I will include all the files that I am working with as a zip file.

I am using MPLAB IDE v8.70 along with a PICKIT2 to program the processor.

Thanks.

Attached File(s)



Is This A Good Question/Topic? 0
  • +

Replies To: dsPIC33F and PWM signals

#2 jimblumberg  Icon User is online

  • member icon

Reputation: 3049
  • View blog
  • Posts: 9,286
  • Joined: 25-December 09

Re: dsPIC33F and PWM signals

Posted 14 September 2011 - 08:52 PM

Quote

Along with this there is a file called krisys_driver.c. This file creates the pwm arguments, testing functions and a bunch of other stuff. It was set up to have two PWM signals and two direction signals.

Does this code work?

Quote

It creates 4 PWM signals using the 4 PWM outputs from the PIC and then it uses 4 D I/O's as direction signals. I have begun testing the code and my direction signals are working because I hooked them up to LED's and verified that they are working. I cannot, however, get my PWM signals to work.

Do any of the PWM signals work? You seem to have a stray '\' in your gsmp_drivers.c file #define Rf_PWM_PIN 25\.

Jim
Was This Post Helpful? 0
  • +
  • -

#3 willist  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 38
  • Joined: 11-April 10

Re: dsPIC33F and PWM signals

Posted 18 September 2011 - 02:10 PM

View Postjimblumberg, on 14 September 2011 - 08:52 PM, said:

Quote

Along with this there is a file called krisys_driver.c. This file creates the pwm arguments, testing functions and a bunch of other stuff. It was set up to have two PWM signals and two direction signals.

Does this code work?

Quote

It creates 4 PWM signals using the 4 PWM outputs from the PIC and then it uses 4 D I/O's as direction signals. I have begun testing the code and my direction signals are working because I hooked them up to LED's and verified that they are working. I cannot, however, get my PWM signals to work.

Do any of the PWM signals work? You seem to have a stray '\' in your gsmp_drivers.c file #define Rf_PWM_PIN 25\.

Jim


None of the PWM signals work. I am confused what this is becuase the direction part of the pwm arguments work, just not the duty cycle.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1