PDA

View Full Version : Plug-a-2138 loads, no blinking


warm38
02-28-09, 03:36 PM
OK. So forget the out-to-lunch JTAG.

RTFM (Read The Friggin Manual) on the Plug-in-board. Set up looks good. When powerd 2 LEDs on the Plug-in-board light up and all 3 light up on the Plug-a-2138.

under Cygwin:
-------------------------------------------------------------------------------

$~/ARM2138/NMtiny2138/rowley/blink/ARM Flash Debug
~/lpc21isp -term blink.hex com5 19200 10000
lpc21isp version 1.63
FIle blink.hex:
loaded...
converted to binary format
image size : 2912
Synchronizing (ESC to abort).......... OK
Read bootcode version: 1
2
Read part ID: LPC2138, 512 kiB ROM / 32 /kiB SRAM (0x2FF25)
Will start programming at Sector 1 if possible, and conclude with Sector 0 to en
sure that checksum is written last.
Sector 0: ......................................................................
.
Download Finished... taking 3 seconds
Now launching the brand new code
Terminal started (press Escape to abort)

-------------------------------------------------------------------------------

No blinking lights.
I remove the boot jumper on J11 and push the reset button.
No blinking lights.



Source (Rowley does a lot of startup):

#include "..\lpc213x.h"

// NewMicros.com Tini2138 and Pluga2138 definitions
#define RED_LED 0x00200000
#define RED_LED_SHIFT 21
#define YEL_LED 0x00400000
#define YEL_LED_SHIFT 22
#define GRN_LED 0x00800000
#define GRN_LED_SHIFT 23

int main (void)
{
unsigned int i;

IO0DIR |= (1<<RED_LED_SHIFT)|(1<<YEL_LED_SHIFT)|(1<<GRN_LED_SHIFT); // P0.21,P0.22,P0.23 as output
IO0SET = (1<<RED_LED_SHIFT)|(1<<YEL_LED_SHIFT)|(1<<GRN_LED_SHIFT); //LED off
while( 1 )
{
for( i = 0; i < 50000; i++ );
IO0SET = 1<<YEL_LED_SHIFT; //LED off
IO0CLR = 1<<RED_LED_SHIFT; //LED off
IO0CLR = 1<<GRN_LED_SHIFT; //LED off
for( i = 0; i < 50000; i++ );
IO0CLR = 1<<YEL_LED_SHIFT; //LED on
IO0SET = 1<<RED_LED_SHIFT; //LED off
IO0SET = 1<<GRN_LED_SHIFT; //LED off
}
}

Ideas? What magical incantations am I missing?
I can always override the Rowley startup...

wade

warm38
03-06-09, 11:01 AM
yuck that last post came out awful after deleting all the less-than characters. No wonder no one caught my error.

The LEDs are on Port *1* NOT Port *0*. DUH!

So now everything is blinking just fine. And since I have my JTAG working, life is so much easier now that I don't have to do the serial port load process. (see the "TiniARM JTAG" thread started by Embedder.)

wade