[SOLVED] Interfacing AD9850 DDS module to PIC18F4520 using C18 compiler

Status
Not open for further replies.
Hi,

I shall try this today, but I am sure I changed the type of processor in MPLAB.

Regads
 


Hi Paul,

I have ordered the PIC18F46k22 and constructed the circuit on vero board exactly like yours less the gain buffer and PIC DDS side things. I am using 10MHz XT crystal.
But getting random frequencies out of DDS if I don't hard wire the D0,D1 and D2 but get totally garbage if I hard wire them according to your schematic.
I have just copy pasted your code and un-commented the port C bits and commented the port B bits.

I can take a picture of my board and send you if that helps.

Regards,
Malik
 

hello,

post a schematic and a picture of your wiring.
what about your power supply..
try to power up with a plate battery 4,5v or 4x1,2v with 470uF across.

another people built this DDS without problem !
so i am confident with the software side.
but need a hardware checking.
 

Hi Paul,

Check this out

http://www.g4jnt.com/AD9850-Controller.pdf

this guy is not hard wiring the D0,D1 and D2 like you are doing and his DDS is also working..

Any ideas why my DDS is not working even after simply copy pasting your tested code into your already used pic P18f46k22..

Please I shall really appreciate your help..
 

Hello,

Hi Paul,

http://www.g4jnt.com/AD9850-Controller.pdf

this guy is not hard wiring the D0,D1 and D2 like you are doing and his DDS is also working..

on this document we can't see internal wiring inside the module ..
The AD9850 data sheet page 12 tells:
Connection for default serial mode operation :
pin 2 to Gnd
pin 3 and 4 to +5V


i saw a schematic ( joined document) , maybe (or NOT ?) the same as mine .. because no document given by the provider mininthebox !
and othe AD9850 application with the same pilosophie...
At least i did a test :
Removing all wiring on D0 D1 D2 .. nothing connected on upper row of the module..
and it's works also Fine !



Code:
 Port comm 19200bds ouvert
  18F46K22_DDS_130519_ADC5b_AD9850_LCD_RS232_No_Joystick_C18.c

 Interface via Terminal RS232 ET/OU via Joystick + LCD
 Gamme de 1 a 25.000Hz  
 18F46K22 40Mhz Q=10Mhz PLLx4
 MPLAB IDE V8.90,C18 V3.44.  
 Version 19/05/13  paulfjujo 

 Facteur DDS PIC = 0.022076
 Init ConsFreq 1Khz	45299	1000.0Hz

Joystick ABSENT ou non centre !!  Vertical =1023  Horizontal=0551 
 valeur seuil bas= 0337 soit 1.6V
 Init sortie DAC= Seuil Haut:  4.096V

 Facteur DDS AD9850 = 34.35973644
 Reglage consigne AD9850 a 00068719 par defaut  soit 2000.0  Hz
 Reglage consigne AD9850 a 343597376  soit 10000000.0  Hz
 Reglage consigne AD9850 a 00034359  soit 1000.0  Hz
 Reglage Freq DDS AD9850 a :   5000.0
 Reglage Freq DDS AD9850 a :   1000.0


what do you get on terminal RS232 ?
Send a picture of your wiring ...
send the result of build on MPLAB output window
use the EXPORT hex file and don't use directly the Hex issue from build, else config bit is not included.

i join my versus again , compare the sise of HEX ..
 

Attachments

  • Image2.jpg
    144 KB · Views: 129
  • 18F46K22_DDS_130519_ADC5b_AD9850_LCD_RS232_No_Joystick_C18.c.txt
    91.5 KB · Views: 71
  • 18F46K22_DDS_AD9850_no_joystick.hex.txt
    183 KB · Views: 78
  • 18F46K22_AD9850_DDS_Test_130605.hex.txt
    183 KB · Views: 56
  • 18F46K22_AD9850_DDS_test.c.txt
    8.2 KB · Views: 76

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…