Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC32 micro controller tutorial

Status
Not open for further replies.

zandoztorm

Newbie level 6
Joined
Feb 9, 2009
Messages
11
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,360
pic32 starter kit

Hi.

I would like to know if someone have already designed a board to use the hirose connector of the PIC32Starter Kit in order to use the peripheral devices.

If you have devolped one, please post it here.

Thanks
 

pic32 schematic

zandoztorm said:
Hi.

I would like to know if someone have already designed a board to use the hirose connector of the PIC32Starter Kit in order to use the peripheral devices.

If you have devolped one, please post it here.

Thanks


I never use PIC32 start kit from Microchip because I build the one for myself. I share it for everybody who want to develop it.
 

pic32 examples

zandoztorm said:
Hi.

I would like to know if someone have already designed a board to use the hirose connector of the PIC32Starter Kit in order to use the peripheral devices.

If you have devolped one, please post it here.

Thanks

And this is the schematic and PCB

**broken link removed**

Code example for LED blink (I correct it from the Example from MC):
//--------------------------/* Khai bao chuong trinh */---------------------

/*
Project name : Dieu khien no su dung vi xu ly

Compiler: C32 v1.04
MPLAB v8.15

CPU: PIC32MX360F512L
XTAL: 8MHz
Input: None
Test point: TP1- LED1 - Yellow(RD1), TP2- LED2 - Green(RD5)
Output: Any pin

Date: 21/11/2008 ---- ???
Written by: Kiem si da tinh
Email: Engr.Hung@gmail.com
Phone number: 0989124480

*/
#include <plib.h>
#include <p32xxxx.h>

// Configuration Bit settings
// SYSCLK = 80 MHz (8MHz Crystal/ FPLLIDIV * FPLLMUL / FPLLODIV)
// PBCLK = 40 MHz
// Primary Osc w/PLL (XT+,HS+,EC+PLL)
// WDT OFF
// Other options are don't care
//
#pragma config FPLLMUL = MUL_20, FPLLIDIV = DIV_2, FPLLODIV = DIV_1, FWDTEN = OFF
#pragma config POSCMOD = HS, FNOSC = PRIPLL, FPBDIV = DIV_8



#define CONFIG (CN_ON | CN_IDLE_CON)
#define PINS (CN15_ENABLE)
#define PULLUPS (CN15_PULLUP_ENABLE)
#define INTERRUPT (CHANGE_INT_ON | CHANGE_INT_PRI_2)

#define SYS_FREQ (80000000L)

int main (void)
{
int i;
unsigned int temp;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//STEP 1. Configure cache, wait states and peripheral bus clock
// Configure the device for maximum performance but do not change the PBDIV
// Given the options, this function will change the flash wait states, RAM
// wait state and enable prefetch cache but will not change the PBDIV.
// The PBDIV value is already set via the pragma FPBDIV option above..

SYSTEMConfig(SYS_FREQ, SYS_CFG_WAIT_STATES | SYS_CFG_PCACHE);

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// STEP 2. configure the port registers
PORTSetPinsDigitalOut(IOPORT_D, BIT_0);
PORTSetPinsDigitalIn(IOPORT_D, BIT_6);

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// STEP 3. initialize the port pin states = outputs low
mPORTDClearBits(BIT_0);
// Note: It is recommended to disable vector interrupts prior to
// configuring the change notice module, if they are enabled.
// The user must read one or more IOPORTs to clear the IO pin
// change notice mismatch condition, then clear the change notice
// interrupt flag before re-enabling the vector interrupts.

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// STEP 4. enable change notice, enable discrete pins and weak pullups
mCNOpen(CONFIG, PINS, PULLUPS);

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// STEP 5. read port(s) to clear mismatch on change notice pins
temp = mPORTDRead();


while(1)
{
i ++;
}
}
 

how to program pic32

Hi KST, thanks for your help.

The schematic you have posted is for buildin a development board, right?
And how do you program the pic32??
 

pic32 development board

Microchip do have a board the the starter kit plugs into and lets you access the ports.

**broken link removed**
 

pic32 starter kit schematic

zandoztorm said:
Hi KST, thanks for your help.

The schematic you have posted is for buildin a development board, right?
And how do you program the pic32??

On the schematic KST provided you see the connector named "ICSP" (Header6).
Well you can use the ICD2 or REAL ICE from Microchip to programm or debug.

**broken link removed**

Best regards
Kabanga
 

    zandoztorm

    Points: 2
    Helpful Answer Positive Rating
pic32 external interrupt example

Kabanga said:
zandoztorm said:
Hi KST, thanks for your help.

The schematic you have posted is for buildin a development board, right?
And how do you program the pic32??

On the schematic KST provided you see the connector named "ICSP" (Header6).
Well you can use the ICD2 or REAL ICE from Microchip to programm or debug.

**broken link removed**

Best regards
Kabanga


You should use MPLAB v8.15 or later, compiler is the C32 from Microchip, programmer is the ICD2. Good luck for you !
 

    zandoztorm

    Points: 2
    Helpful Answer Positive Rating
pic32

Thanks KST, thanks Kabanga ..... +3pts :D
 

pic32 disable interrupts

zandoztorm said:
Thanks KST, thanks Kabanga ..... +3pts :D

your welcome :D
And follow the link bellow. You'll find many PIC32 examples (with schematics and codes !!!).

Best regards
Kabanga

Added after 42 seconds:

sorry here is the link

**broken link removed**

:D
 

PIC32 Starter Kit

KST, thật vui khi gặp thành viên là người Việt Nam ở diễn ðàn này ---> I am very glad to see Vietnamese people here ^^

Good job KST
 

well i have placed PIC32MX360F512L device on a simple board...and added some capacitors to it...and tried to connect to PICKit2...and it says to me VPP voltage level error... however i did connect everything right... but only thing which is weird for me on this PDF schematic is u are using inductor between avcc and agnd???

or what?
 

BlackOps said:
well i have placed PIC32MX360F512L device on a simple board...and added some capacitors to it...and tried to connect to PICKit2...and it says to me VPP voltage level error... however i did connect everything right... but only thing which is weird for me on this PDF schematic is u are using inductor between avcc and agnd???

or what?

You should try to test kind of your PIC, may be PICKIT2 don;t support for this PIC.
Good luck for U !
 

MPLAB IDE doesn't support prgm/debugging PIC32 using PicKit2 but, pickit 2 stand alone programmer will support PIC32 programming.
 

Re: pic32 schematic

Hi,

I've saw your dev board to pic32. Could you share project files like pcb design ?:)
 

MPLAB IDE doesn't support prgm/debugging PIC32 using PicKit2 but, pickit 2 stand alone programmer will support PIC32 programming.
It's sound good. So, you mean third party PicKit2 software can program PIC32? I have bought PIC32 starter kit and only have PicKit2 programmer.

For thread starter, this is one of PIC32 Starter Kit.
 
I was under the impression that the pic32 starter has a built in programmer and debugger and is accessed via the supplied usb cable
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top