dspic30f4011 programming pinout

Thread Starter

bassplayer142

Joined Jan 2, 2007
89
I finally got all my equipment and am ready to program a chip and get something basic running. I have the pickit2 now and it has 6 output pins. I'm not sure what has to be connected to what. The datasheet can be seen below with the pin characteristics on page 12 and 13.

http://ww1.microchip.com/downloads/en/DeviceDoc/70135F.pdf

First off, what is the difference of AVdd & AVss with respect to Vdd & Vss? Is the one with A in front of it for powering the chip, and the other one for powering I/O pins? Should I just power and ground them both?

I don't know what pins to connect the programmer to either. If there is a tutorial somewhere or a datasheet that would be great. Also, I read that the MCLR should be connected to a pullup resistor of 10k.

Sorry for the many, many questions and thanks in advance.
 

Thread Starter

bassplayer142

Joined Jan 2, 2007
89
Thanks for all the help. I finally got a led to blink so at least I know I'm doing something right :). A few more questions.

1. Why is there three Vss and Vdd pins? Right now I'm grouding and supplying to each of them. Would one suffice?

2. The code below I found online to configure the clock. The only information from a pdf I could find is below that. I don't understand where these names come from. I'm used to setting a register with a hex value to configure these things. What is the underscore for? Thanks in advance, you guys have been really helpful. :)

_FOSC(CSW_FSCM_OFF & FRC); //code to config clock

6.6.1 Configuration Bits Setup Macros
Macros are provided that can be used to set configuration bits. For example, to set the
FOSC bit using a macro, the following line of code can be inserted before the beginning
of your C source code:
_FOSC(CSW_FSCM_ON & EC_PLL16);
This would enable the external clock with the PLL set to 16x and enable clock switching
and fail-safe clock monitoring.
Similarly, to set the FBORPOR bit:
_FBORPOR(PBOR_ON & BORV_27 & PWRT_ON_64 & MCLR_DIS);
This would enable Brown-out Reset at 2.7 Volts and initialize the Power-up timer to 64
milliseconds and configure the use of the MCLR pin for I/O.
For a complete list of settings valid for each configuration bit, refer to the processor
header file.
 

rjenkins

Joined Nov 6, 2005
1,013
Definitely connect all power pins.

They probably go to different areas of the die, so the internal connection is via the chip.

While it may work with no I/O loading if one pin is left open, it will probably cause erratic operation or damage once you are using the I/O pins.

The underscores in variable or constant names are an alternative to spaces, as embedded spaces are not allowed. It's supposed to make the abbreviations more readable, but that is a matter of opinion.

The _leading underscores are often indicators of special compiler functions or definitions, to minimise the chance of a program variable name conflicting.

The constant names themselves will be from a compiler header file, probably one specific to the MPU you are using.

eg. I use the CCS compilers & part of the setup with those is an #include that refers to the processor type number.h near the start of the program.

That sets up constants for all the register config bits that are specific to the chip you are working with.
 

Thread Starter

bassplayer142

Joined Jan 2, 2007
89
I have this line in the beginning.

#include <p30f4011.h>

I'm confused because in mplab's box thingy there is only my main.c. I didn't even have to add the file p30f4011.h to the source. Is there some way I can look into that file or a datasheet about it? Thanks.

edit: Just found the file in a directory, I will take a look into that.
 

rjenkins

Joined Nov 6, 2005
1,013
Yeah, the setup is different for each tool set, I only use MPLab itself for assembly and the CCS PICC compiler as an add-on for C, still working with the MPLab IDE.

Which compiler are you using?
 

Thread Starter

bassplayer142

Joined Jan 2, 2007
89
I'm still unable to understand where these clock statements are coming from. I understand that it is probably in an include somewhere but I can't seem to decipher any of them. For instance I found these both online and set up a delay and toggled an output. I then read it using pickit2 logic tool and found that the clock was still the exact same frequency when the second one should be a 16x multiplier. thanks
_FOSC(CSW_FSCM_OFF & FRC);

_FOSC(CSW_FSCM_ON & XT_PLL16);
 
Top