BASICchip pullup and pulldown resistors

Questions on other types of hardware and getting it talking to the ARM CPU
Post Reply
YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

BASICchip pullup and pulldown resistors

Post by YahooArchive »

>from the help line
>Am using you basic chip product and I have figured out how to set Input/Output
pins. However, I have not been able to successfully set the internal
pull-up/down resistors on the GPIO pins of the LPC1114 using your basic
commands. How can I do this?

The default condition for most pins on the BASICchip are an input with a pullup
resistor.

The input/output state is controlled by the INPUT, OUTPUT, DIR and IO statements
as you have found.

To control the pullup/pulldown, you need to write to the control registers as
defined in the NXP User Manual (a copy in the Coridium directory is installed
with the other tools).

Those pins are defined by the MODE field (bits 4:3) of each of the controls on
an individual pin basis. For instance IO(2) is P0.2 and controlled by the
register.

IOCON_PIO0_2 = IOCON_PIO0_2 and &Hffffffe7 ' disable both

IOCON_PIO0_2 = IOCON_PIO0_2 and &Hffffffe7 or 8 ' enable pulldown

These registers can be used by #include "LPC11xx.bas"



Post Reply