Created Wed, 11 Jan 2012 10:50:23 +0000 by Leena
Wed, 11 Jan 2012 10:50:23 +0000
am trying to turn on all of the LEDs in the basic io shield with max32 board, as mentioned in the basic I/O shield refrence manual
max32 pin# LED 77 LD1 76 LD2 75 LD3 74 LD4 73 LD5 72 LD6 71 LD7 70 LD8
i tried to follow max32 schematic documentation to turn on these LEDs but it didnt work for me!
#pragma config FPLLMUL = MUL_20, FPLLIDIV = DIV_2, FPLLODIV = DIV_1, FWDTEN = OFF
#pragma config POSCMOD = HS, FNOSC = PRIPLL, FPBDIV = DIV_1
#define SYS_FREQ (80000000L)
#define BAUDRATE (9600) //The desired BaudRate
#define DELAY 36000 //256ms
void testLEDs()
{
// initialization
TRISD = 0x0; // all PORTD as output
AD1PCFG=0xFFFF;
T1CON = 0x8030; // 1000 0000 0011 0000 TMR1 on, prescale 1:256
PR1 = 0XFFFF; // set period register to max
while(1)
{
PORTD = 0xFFFF;
TMR1 = 0;
while ( TMR1 < DELAY)
{
// WAIT
}
PORTD = 0;
TMR1 = 0;
while ( TMR1 < DELAY)
{
// WAIT
}
}
}
this method it turn ON LD8,LD7 and LD5 how can i test the rest of the LEDs i have tried to turn on some of the bins on portA and portC according to the chipkit schematic design but still it is not working;
Wed, 11 Jan 2012 11:59:56 +0000
i have been able to turn on all of the LEDs on the IO shield except LD6 (after disabling the JTAG)!
any idea how can i turn on LD6 on the basic IO shield ?
Wed, 15 Feb 2012 23:22:57 +0000
Hello,
I assume you have the Basic I/O Shield directly plugged into the Max32 board. Please try the following code. I just added the LD6 to the blink demo:
/*
Blink
Turns on an LED on for one second, then off for one second, repeatedly.
This example code is in the public domain.
*/
void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
TRISCCLR = (1 << 13);
}
void loop() {
PORTCSET = (1 << 13);
digitalWrite(13, HIGH); // set the LED on
delay(1000); // wait for a second
PORTCCLR = (1 << 13);
digitalWrite(13, LOW); // set the LED off
delay(1000); // wait for a second
}
Let me know if this works or not.
Best Regards, Ryan K
Sun, 18 Mar 2012 00:17:10 +0000
Leena--how dd you turn off the JTAG?