Hi I'm trying to do some practice with the 8bit uC AduC 842 When i generate a ramp by means of its DAC there are some glitches,in different number and position each time a ramp is generated
i vary the DAC out in this way
int i,del; DACCON=0x0D; //Async,DAC0 on ,DAC1 off ADCCON1=0xAC;//Power up ADC/8 + 4 acq clock .. for(i=0;i> 8; DAC0L=i & 0x0FF;
del=10; while(del){del--}//wait for DAC setting ...
}reading the value with the ADC itself,that has the same Vref as the DAC.,shows that the glitches always happen in cases like this:
misured DAC output at t-1=0x2FC (next value expected is 0x300,followed by
0x304) misured DAC output at t =0x3FF (wrong) misured DAC output at t +1 =0x304 (correct)Did i forget anything in initialization that justifies such a behaviour? How should I modify the code?
Thanks for help,hints and for your attention
Diego