dsPIC30F6014a-ICSP & UART

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

dsPIC30F6014a-ICSP & UART

Postby fazlul76 » Wed Feb 03, 2016 12:31 pm

Hi all,

I am using dspic30F6014a for my project.I'm new to the device and hope to get more information and guide from this forum. I am using picKIT2, with ICSP USB PIC programmer (UIC00B) and also USB to UART converter (UC00A) for serial communication. I have a code written in CCS C compiler and hardly trying to see the output from the dsPIC. I still had no idea what actually causing the pic from working properly. I loaded a simple LED ON/OFF at pin_C1 with delay 1ms but no output. This is what I have done so far:
a) using the picKIT 2 the dspic can be found.
b) erased the dspic30F - successful
c) loaded the dspic with the simple LED ON/OFF code - successful
d) verify the dspic30F -successful

with the step above the dspic failed to give the output.

Then I go to tools>troubleshoot to test the dspic with another method.
a) Verify Vdd -passed
b) Test Vpp - passed

Can anyone help me what kind of problems do I have with the dspic? Is there any methods to test which part (dspic, UIC00B, UC00A) caused the failure? If the failure comes from the dspic why i still can write, erase and verify the device? Please advice.

Thank you
fazlul76
Greenhorn
 
Posts: 3
Joined: Wed Feb 03, 2016 12:03 pm

Re: dsPIC30F6014a-ICSP & UART

Postby ober » Wed Feb 03, 2016 2:24 pm

Photos of hardware setup would be helpful.

BTW, human eyes cannot see if the LED is blinking at 1ms rate.
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: dsPIC30F6014a-ICSP & UART

Postby fazlul76 » Wed Feb 03, 2016 4:49 pm

Hi,

The output was confirmed using oscilloscope. Sorry the blinking LED code is 1s not 1ms. The attached image was to send 1s pulse output from pin_C1 to LED#1. Here is the code:

Regards

CODE: SELECT_ALL_CODE
#include <delay_1us.h>


void main()
{

   //Example blinking LED program
   while(true)
   {
      output_low(LED);
      delay_ms(DELAY);
      output_high(LED);
      delay_ms(DELAY);
   }

}


and here is the .h file
CODE: SELECT_ALL_CODE
#include <30F6014A.h>

#FUSES NOWDT                    //No Watch Dog Timer
#FUSES CKSFSM                   //Clock Switching is enabled, fail Safe clock monitor is enabled
#FUSES NOBROWNOUT               //No brownout reset

#device ICSP=1
#use delay(crystal=20000000)

#define LED PIN_C1
#define DELAY 1000
Attachments
pic30f.jpg
fazlul76
Greenhorn
 
Posts: 3
Joined: Wed Feb 03, 2016 12:03 pm

Re: dsPIC30F6014a-ICSP & UART

Postby ober » Thu Feb 04, 2016 4:01 pm

The development board does not seem to be from Cytron, maybe you can check with the designer or manufacturer, there should be some example code.

Anyway, from your code, there should be initialization of Input and output, but I did not see any of those.
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm


Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 1 guest

cron