SuperPRO port configuration and control
Posted: Mon Feb 11, 2013 1:43 pm
I am excited to learn the operation of the SuperPRO (new to microcontroller
programming). I could really use some help figuring out how to program ports
and pins with the SuperPRO. These statements were copied from the ARMbasic Help
files and the LED does blink (docs say the LED is Port 0 pin 15?), but don't
understand why it works, or rather, what exactly is happening with these two
statements, and what Port/pin is it really being affecting. There is nothing in
the following two statements I frankly relate to:
#define OUTPUT2(pin) FIO2DIR = FIO2DIR or (1 << pin)
OUTPUT2(10)
Thanks for any light you could shed.
Keith Wilde
'The simplified sample file from ARMbasic
#include
#define OUTPUT2(pin) FIO2DIR = FIO2DIR or (1 << pin)
OUTPUT2(10)
while 1
x=x+1
P2(10) = (x and 1) ' blinky for the SuperPRO and PROplus
wait(500)
loop
programming). I could really use some help figuring out how to program ports
and pins with the SuperPRO. These statements were copied from the ARMbasic Help
files and the LED does blink (docs say the LED is Port 0 pin 15?), but don't
understand why it works, or rather, what exactly is happening with these two
statements, and what Port/pin is it really being affecting. There is nothing in
the following two statements I frankly relate to:
#define OUTPUT2(pin) FIO2DIR = FIO2DIR or (1 << pin)
OUTPUT2(10)
Thanks for any light you could shed.
Keith Wilde
'The simplified sample file from ARMbasic
#include
#define OUTPUT2(pin) FIO2DIR = FIO2DIR or (1 << pin)
OUTPUT2(10)
while 1
x=x+1
P2(10) = (x and 1) ' blinky for the SuperPRO and PROplus
wait(500)
loop