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

dsPic33EP512GM710 on Explorer16 - Blinking LED ?! [SOLVED]

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



Joined: 21 Dec 2011
Posts: 42

View user's profile Send private message

dsPic33EP512GM710 on Explorer16 - Blinking LED ?! [SOLVED]
PostPosted: Wed Nov 11, 2015 4:58 am     Reply with quote

hi,

I'm trying to play with a dspic but i have difficulty and in spite of return to basic programming, nothing...

So, i would to make blinking a led (When i talk about return to basic...).
My dev board work well because i use it for different projects (Pic24 and Pic18).
Code:

#include <33EP512gm710.h>

#fuses HS
#FUSES ICSP1
#fuses NOWDT
#fuses NODEBUG

#use delay(crystal=8M)

//--------------------------------------------
void main (void)
{
    output_high(PIN_A0);
   for(;;)
   {
      output_high(PIN_A4);
      delay_ms(250);
      output_low(PIN_A4);
      delay_ms(250);
   }
}
//--------------------------------------------

If you see something, like a big mistake, i will be happy.... I think that i have forgot someting but what....


MPLAB X 3.15 /CCS version 5.015
Dev Board Microchip Explorer16 / Programmer PICKIT3 from Microchip.


Last edited by joseph20480 on Wed Nov 11, 2015 10:57 am; edited 1 time in total
Ttelmah



Joined: 11 Mar 2010
Posts: 19554

View user's profile Send private message

PostPosted: Wed Nov 11, 2015 5:19 am     Reply with quote

First, for 8MHz, you want XT on these chips. On these HS is for 10MHz or more.

Then on most of these, you have to actually enable the oscillator, so you need 'PR', as well as 'XT', to tell it you are using the primary oscillator.

So try:
Code:

#include <33EP512gm710.h>

#fuses XT //3.5 to 10MHz
#fuses PR //primary oscillator
#fuses NOOSCIO //and ensure the OSC2 pin is configured
#FUSES ICSP1
#fuses NOWDT
#fuses NODEBUG


Not sure, haven't played with this exact chip, but know on others in the family, you must have the PR fuse. I think NOOSCIO should default correctly, but 'playing safe'....
joseph20480



Joined: 21 Dec 2011
Posts: 42

View user's profile Send private message

PostPosted: Wed Nov 11, 2015 5:31 am     Reply with quote

Thanks for your rapid reply.
Your suggestion is good/true, but not my led is always off...

nothing else ?
Ttelmah



Joined: 11 Mar 2010
Posts: 19554

View user's profile Send private message

PostPosted: Wed Nov 11, 2015 7:57 am     Reply with quote

Take a step back.
Run it up with the internal oscillator first. This will at least prove that the chip is powering up correctly, and the LED/power connections are all working OK. Once this is going then switch back to trying to get the crystal running.
joseph20480



Joined: 21 Dec 2011
Posts: 42

View user's profile Send private message

PostPosted: Wed Nov 11, 2015 11:00 am     Reply with quote

ok.... it's work....
SO my problem was not a programming problem but documentation problem.
The DSPIc33EP is so different than 24f/33fj, that the pin placement is different...
it's all.
Pin_Ax change to Pin_Fx....
i'm confused, but i'm not crazy.
bye
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