I wrote a simple code for output both channels to an osciloscope. But DAC module 0 P2.0 waveform(sawtooth) is much distorted. The other DAC module 1 (P0.4) outputs a perfect sawtooth. Any ideas (?) By the way i am sure it is not the code or the Tektronix oldwolf oscilloscope :(
Take a look at the code :
#include <REG935.H> void main() { unsigned char data x; //configure Port 2 as quasi-bidirectional P2M1 = 0x00; P2M2 = 0x00; //Configure the DAC ADCON0 = 0x04; //AD0 enabled ADCON1 = 0x04; //AD1 enabled ADMODB = 0x0C; //DAC mode for ADC0 & 1 //Sawtooth wave generation while(1) { for(x=0; x<256; x++) { AD0DAT3 = x; //write to conversion register AD1DAT3 = x; //write to conversion register } } }
.
A digital output pin can't generate a sawtooth without a low-pass filter.
How have you connected the two pins? Do you have any pull-up resistor on P2.0 that you say you run in quasi-bidirectional mode?
All pins are in Bidirectional Mode (Both channels). No LPF at any channel. At DAC0 module > Perfect sawtooth At DAC1 module > Distorted sawtooth
The MCB900 evaluation board used, oscillator probes directly at I/O header pins.
Is it possible that Zinput of the latch chip connected to MCB900 board to distort the output(?) -- pin 1 of uC goes to pin17 of latch to drive the leds --