View previous topic :: View next topic |
Author |
Message |
joseph20480
Joined: 21 Dec 2011 Posts: 42
|
dsPic33EP512GM710 on Explorer16 - Blinking LED ?! [SOLVED] |
Posted: Wed Nov 11, 2015 4:58 am |
|
|
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: 19553
|
|
Posted: Wed Nov 11, 2015 5:19 am |
|
|
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
|
|
Posted: Wed Nov 11, 2015 5:31 am |
|
|
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: 19553
|
|
Posted: Wed Nov 11, 2015 7:57 am |
|
|
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
|
|
Posted: Wed Nov 11, 2015 11:00 am |
|
|
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 |
|
|
|