I am testing the Basic Chip for the first time. I have control of the IO pins as outputs, except the ones that are AD0 to AD5.
I tried first using x=IO(32), for AD1 (pin9), then using IO(32)=1 to set it high - but no response at the pin. I also tried OUTPUT(32) first then IO(32)=1 with no responce.
I have the AVdd and AVss connected to Vdd and Vss. I tried this on two BasicChips with same results.
Is it some connection problem, or do I need to make some software call to get ADs to be outputs?
Thanks for any advice.
Basic Chip AD as outputs
Re: Basic Chip AD as outputs
For now you will have to explicitly change AD inputs to digital IOs with the following code
Code: Select all
#include <LPC11xx.bas>
IOCON_PIO1_4 = &H90 ' convert AD(5) to digital input or output
IOCON_SWDIO_PIO1_3 = &H91 'AD(4)
IOCON_R_PIO1_2 = &H91 'AD(3)
IOCON_R_PIO1_1 = &H91 'AD(2)
IOCON_R_PIO1_0 = &H91 'AD(1)
IOCON_R_PIO0_11 = &H91 'AD(0)
Re: Basic Chip AD as outputs
Thank you for the information. I could not find it in any documentation that I looked through.
I now have control of the AD pins as outputs except for AD(4). When set as an output, that pin stays high and using IO(35)=0 does not set it low. I can live with that, as I don't need that pin yet, but it is odd. Any thoughts?
I now have control of the AD pins as outputs except for AD(4). When set as an output, that pin stays high and using IO(35)=0 does not set it low. I can live with that, as I don't need that pin yet, but it is odd. Any thoughts?
Re: Basic Chip AD as outputs
That code is taken from the BASIC help files pages on Pin Controls for AD.
Though the second line (corrected now) should be
IOCON_SWDIO_PIO1_3 = &H91 'AD(4)
And that information (cue broken record) is in the NXP help files on the IOCON, which admitedly is quite scattered and inconsistent
Though the second line (corrected now) should be
IOCON_SWDIO_PIO1_3 = &H91 'AD(4)
And that information (cue broken record) is in the NXP help files on the IOCON, which admitedly is quite scattered and inconsistent
Re: Basic Chip AD as outputs
Thank you, sir. "As of now, I am in control."