How to program AD9834 DDS using a PIC16F877A?

Thread Starter

syams86

Joined Jan 29, 2014
3
Hi everybody,
I am going to control Analog Devices AD9834 DDS using a PIC16F877A micro controller using PORTB of uC via 3wire(SCK,SDI,FSYNC) SPI communication. FSELECT and PSELECT Pins permenentaly grounded. RESET pin is connected in one of the pin in PORTB. I uses 20MHz master clock for AD9834 DDS device to generate a 19kHz sine wave output. Kindly suggest a pseudo code or C code for the firmware of PIC16F877A to control/program AD9834 DDS.
 

Thread Starter

syams86

Joined Jan 29, 2014
3
It would help if you told us which C compiler you use. And also what part of the programming you struggle with
I would like to use either Hitech-C or mikro-C Compiler for my project. Actually I would like to generate four coherent sine waveforms they are19kHz<0degree, 38kHz<0degree, 38kHz<90degree and 76kHz<0degree by using four AD9834 DDS connected to PORTB and PORTD with a common RESET and MASTERCLOCK for all DDS chip. At least I need a code to communicate PIC uC to a single DDS chip as reference so that I can develop the code for PIC uc to communicate to all the four chips. The ports of PIC uC are connected as shown below:

RB0-->DDS_SCLOCK1
RB1-->DDS_SDATA1
RB2-->DDS_FSYNC1

RB3-->DDS_RESET

RB4-->DDS_SCLOCK2
RB5-->DDS_SDATA2
RB6-->DDS_FSYNC2

RD0-->DDS_SCLOCK3
RD1-->DDS_SDATA3
RD2-->DDS_FSYNC3

RD4-->DDS_SCLOCK4
RD5-->DDS_SDATA4
RD6-->DDS_FSYNC4

I would like to use Software SPI for this project.
 
Top