My first run with ADUC842

Today I got a ADUC development board in our store, so I started with my task, the same task sinewave generation, reading back the sinewave and saving the sinewave samples in external ram(actually the xram is inside the chip, but it is interfaced as external). There was a crystal attached to the chip . but the crystal attached to the chip was not active by default. The system clock is decided by a internal PLL circuit and is controlled by CONFG842 sfr.

Sinewave generation with the DAC0

I had taken 6 samples per cycle which was not enough(which was simulated accurate sinewave in proteus). So I had to increase the sample rate to 36 per cycle(10 degree interval). Rest job was to read the sinewave .

Reading Sinewave normal and DMA mode

Using adc with ADUC is a bit complex at software part and simple at hardware, because you have to configure 3 sfr’s ADC1-3. The data will be written at ADCDATAH and ADCDATAL two 8bit registers. Actually ADCDATAH contains the ADC channel id at the higher 4 bit locations and the higher 4 bit of the ADCread value at the lower 4 cells. Save both the values in an integer variable.

Saving the data in RAM

The adcread values need to b saved at some location for further processing. This is better with some external RAM(XRAM), fortunately we have 2KB of external ram inside the microcontroller.

Signal processing

Perhaps this is the last job that I have to do for my thesis, I need some FFT calculation to get the impedance value from the samples read by ADC.

Is it simple

This is all I have to do for now. From the first stage to the last stage there are a lot of hidden problems. Getting a pure sinewave at a high frequency wwith tradeoff between frequency and sinewave shape…

Published by

ASIM MAHAKUL

Hello, I am Asim admin of this blog. An expert in Scientific Instrumentation (Analytical Instrumentation). My works are always associated with both Physics and electronics. Currently working on ARM based embedded systems for Optical(UV and Visible) and electrochemical spectroscopy (EIS). My M.Tech. Thesis was related to all these things. I had worked for a 8 bit microcontroller based standalone EIS (electrical impedance spectroscopy) device. I have Masters in Instrumentation engineering from NIT Kurukshetra,Haryana and Masters in Electronics Science from Sambalpur University, Odisha (Formerly Orissa/Utkal) Am also work for PHP MySQL AJAX based CMS design. i love blogging and coding(am not an expert).

Leave a Reply