Flash Magic

Not Wiring

The code example is not really Arduino code but an LPCXpresso C++ project with definitions to make the Arduino Blink code example compile.

The compiled code is about 750bytes.

It's still smaller than the Blink compiled on an AVR platform.This is because the 32-bit ARM has a more efficient code than the 8-bit AVR.

The Catweazle can run code at a blistering speed compared to an AVR making it a great option for DSP or speed demanding applications. It can do a 32x32bit multiplication in a single clockcycle !!!

Sure, It does not have an onboard ADC converter for analog signals but it has an analog comparator that can do delta/sigma conversations in higher a resolution than any AVR chip is capable of. At CD-Audio speed.

The Arduino Blink example

the_arduino_blink_example.cpp

The Arduino Blink example

Warning: Embedding code files within the project story has been deprecated. To edit this file or add more files, go to the "Software" tab. To remove this file from the story, click on it to trigger the context menu, then click the trash can button (this won't delete it from the "Software" tab).

//**************************************************************************/// CatWeazle main.c with Arduino style definitions//**************************************************************************/#include "LPC8xx.h"#include "gpio.h"#include "mrt.h"#define INPUT 0#define OUTPUT 1#define HIGH 1#define LOW 0voidpinMode(uint8_tpin,uint8_tmode){if(mode==1){LPC_GPIO_PORT->DIR0|=(1<<pin);}else{LPC_GPIO_PORT->DIR0&=(0xffffffff-(1<<pin));}}voiddigitalWrite(uint8_tpin,uint8_tmode){if(mode==1){LPC_GPIO_PORT->SET0=1<<pin;}else{LPC_GPIO_PORT->CLR0=1<<pin;}}voiddelay(uint32_tmillis){mrtDelay(millis);}//-------------------------- Arduino section --------------------------------/* Blink Turns on an LED on for one second, then off for one second, repeatedly. This example code is in the public domain. */// Pin 13 has an LED connected on most Arduino boards.// give it a name:intled=2;// the setup routine runs once when you press reset:voidsetup(){// initialize the digital pin as an output.pinMode(led,OUTPUT);}// the loop routine runs over and over again forever:voidloop(){digitalWrite(led,HIGH);// turn the LED on (HIGH is the voltage level)delay(1000);// wait for a seconddigitalWrite(led,LOW);// turn the LED off by making the voltage LOWdelay(1000);// wait for a second}//-------------------------------------------------------------------------------------------intmain(void){/* Initialise the GPIO block */gpioInit();/* Configure the multi-rate timer for 1ms ticks */mrtInit(__SYSTEM_CLOCK/1000);LPC_SWM->PINENABLE0=0xffffffffUL;//All 6 GPIO enabledsetup();while(1){loop();}}

Mounted and tested

the_arduino_blink_example.cpp

//**************************************************************************/// CatWeazle main.c with Arduino style definitions//**************************************************************************/#include "LPC8xx.h"#include "gpio.h"#include "mrt.h"#define INPUT 0#define OUTPUT 1#define HIGH 1#define LOW 0voidpinMode(uint8_tpin,uint8_tmode){if(mode==1){LPC_GPIO_PORT->DIR0|=(1<<pin);}else{LPC_GPIO_PORT->DIR0&=(0xffffffff-(1<<pin));}}voiddigitalWrite(uint8_tpin,uint8_tmode){if(mode==1){LPC_GPIO_PORT->SET0=1<<pin;}else{LPC_GPIO_PORT->CLR0=1<<pin;}}voiddelay(uint32_tmillis){mrtDelay(millis);}//-------------------------- Arduino section --------------------------------/* Blink Turns on an LED on for one second, then off for one second, repeatedly. This example code is in the public domain. */// Pin 13 has an LED connected on most Arduino boards.// give it a name:intled=2;// the setup routine runs once when you press reset:voidsetup(){// initialize the digital pin as an output.pinMode(led,OUTPUT);}// the loop routine runs over and over again forever:voidloop(){digitalWrite(led,HIGH);// turn the LED on (HIGH is the voltage level)delay(1000);// wait for a seconddigitalWrite(led,LOW);// turn the LED off by making the voltage LOWdelay(1000);// wait for a second}//-------------------------------------------------------------------------------------------intmain(void){/* Initialise the GPIO block */gpioInit();/* Configure the multi-rate timer for 1ms ticks */mrtInit(__SYSTEM_CLOCK/1000);LPC_SWM->PINENABLE0=0xffffffffUL;//All 6 GPIO enabledsetup();while(1){loop();}}