Im testing the uVision3 v8.16 IDE in connection with ADIs original ADuC814 eval board. When driving the DACs, everything works as long as IÂ'm NOT using printf.
Does printf reset the DAC settings or something like this ?
I inserted a condition so that fprint gets first used after some time, it works the first time until printf is used the first time, so i assume it is printf and not global stdio that does the effekt
Please see the small example below. When removing the printf command DAC0 will correctly output a sawtooth wave but not anymore when the printf is included
...
#include <stdio.h> #include <REG52.H>
sfr PLLCON = 0xD7; // PLL CONFIGURATION BYTE sfr DACCON = 0xFD; // DAC CONTROL REGISTER sfr DAC0L = 0xF9; // DAC0 DATA
unsigned char Output;
void main(void) {
PLLCON = 0x00; // CPU 16.0MHz Clock DACCON = 0xFF; // set both DACs: on, 08bit
while (1) {
DAC0L = Output; Output++;
printf("%02bX \n",Output); }
}