DAC access
Posted: Sun Feb 10, 2013 9:03 pm
>from help line
>For your SuperPRO, which has 1 DAC channel, what\'s the BASIC instruction /
keyword to output analog data. You have the AD keyword for inputting analog
data, but I don\'t see anything for the DAC.
There is no keyword in BASIC for DA access, but it can easily be done with a
library or SUB
from NXP user manual for LPC1756
The DAC is configured using the following registers:
1. Power: The DAC is always connected to VDDA. Register access is determined by
PINSEL and PINMODE settings (see below).
2. Clock: In the PCLKSEL0 register (Table 4–40), select PCLK_DAC.
3. Pins: Enable the DAC pin through the PINSEL registers. Select pin mode for
port pin
with DAC through the PINMODE registers (Section 8–5). This must be done before
accessing any DAC registers.
#include
SUB SETUP_DAC()
PCB_PINSEL1 = (2 << 20)
END SUB
SUB DACOUT(value)
DACR = value
END SUB
>For your SuperPRO, which has 1 DAC channel, what\'s the BASIC instruction /
keyword to output analog data. You have the AD keyword for inputting analog
data, but I don\'t see anything for the DAC.
There is no keyword in BASIC for DA access, but it can easily be done with a
library or SUB
from NXP user manual for LPC1756
The DAC is configured using the following registers:
1. Power: The DAC is always connected to VDDA. Register access is determined by
PINSEL and PINMODE settings (see below).
2. Clock: In the PCLKSEL0 register (Table 4–40), select PCLK_DAC.
3. Pins: Enable the DAC pin through the PINSEL registers. Select pin mode for
port pin
with DAC through the PINMODE registers (Section 8–5). This must be done before
accessing any DAC registers.
#include
SUB SETUP_DAC()
PCB_PINSEL1 = (2 << 20)
END SUB
SUB DACOUT(value)
DACR = value
END SUB