Content originally posted in LPCWare by adi nata on Fri May 02 07:22:58 MST 2014
thanks for the information
but for newbie like me, it takes hours to understand...
let make it easier
SystemInit();
CGU_Init();
scu_pinmux(0x4 ,4 , MD_PLN, 0); // set pin configuration register
GPIO_SetDir(0x4, 4, 0); // set GPIO port direction register
LPC_SCU->ENAIO2 |= 1; // set analog function select register
DAC_Init(LPC_DAC);
LPC_DAC->CTRL |= DAC_DMA_ENA;
int32_t iLop;
while(1)
{
for (iLop = 0; iLop < 1023; iLop++)DAC_UpdateValue(LPC_DAC, iLop);
for (iLop = 1023; iLop > 0; iLop--)DAC_UpdateValue(LPC_DAC, iLop);
}