Question

I have purchased a uC32 Chipkit (with a Pic32MX340F512H). I have a PicKit3 for development. I need to know where I can find a simple development project that I can build and download to the board. All I want to do is flash and LED so I can see that the tools are all working together. I have downloaded and installed MPLAB X IDE v3.05 from MicroChip. Would really be good if I can find a tutorial.

Edited by Gary Armstrong
Link to post
Share on other sites

6 answers to this question

Recommended Posts

  • 0

try this program (blinks led on ChipKIT Uno32 pin #8 which is PORTD#10 in PIC32 numbering)

https://github.com/1i7/verilog-basics/blob/master/mips-pic32/task3-blink-c/blink.c

 

#include <p32xxxx.h>
/**
 * Помигать лампочкой на ножке pic32 RD10 (chipKIT #8).
 */

/**
 * Настраиваем пины ввода-вывода и таймер.
 */
void setup() {
    // режим вывода для ножки RD10 - установить бит PORTD[10] в 0
    TRISDCLR = 1 << 10;

    // включить таймер
    T1CON = 0x8030;
}

/**
 * Запуск бесконечного цикла с миганием.
 */
void blink() {
    while(1) {
        // установить значение - включить лампочку
        PORTDSET = 1 << 10;

        // подождать
        TMR1 = 0;
        while(TMR1 < 0xffff) {            
        }

        // очистить значение - выключить лампочку
        PORTDCLR = 1 << 10;

        // подождать
        TMR1 = 0;
        while(TMR1 < 0xffff) {
        }	
	}
}

void main() {  
    setup();

    blink();
}

 

Link to post
Share on other sites
  • 0

ChipKit uC32 Board Ref Mnl indicates that user LEDs are located on signal pins 13 and 43 (page 3 of 7). The Excel spread sheet (ChipKit Pinout Table xls) Indicated tat those pins belong to RG6 and RF0. Toggling the bits on those ports does not flash the lights?

PORTFSET = 1;

PORTGSET = 1<<6;

...

PORTFCLR = 1;

PORTGCLR = 1<<6;

Okay, that worked.

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now