How to program AD9834 DDS using a PIC16F877A?

Discussion in 'Embedded Systems and Microcontrollers' started by syams86, Jan 29, 2014.

  1. syams86

    Thread Starter New Member

    Jan 29, 2014
    3
    0
    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.
     
  2. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    It would help if you told us which C compiler you use. And also what part of the programming you struggle with
     
    syams86 likes this.
  3. Ian Rogers

    Member

    Dec 12, 2012
    158
    29
    Also as the SPI module is on PORTC... Are you going to use software SPI?
     
    syams86 likes this.
  4. syams86

    Thread Starter New Member

    Jan 29, 2014
    3
    0
    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.
     
  5. syams86

    Thread Starter New Member

    Jan 29, 2014
    3
    0
    Ya,I would like to use Software SPI for this project.
     
Loading...