In SX Microcontrollers, SX/B Compiler and SX-Key Tool, mike.blankenship wrote: I am having trouble setting up the registers for this A/D using the SHIFTOUT Command. I am using the following Basic Setup flow on Page 29 of the DataSheet : [url=http://datasheets.maxim-ic.com/en/ds/MAX1415-MAX1416.pdf]http://datasheets.maxim-ic.com/en/ds/MAX1415-MAX1416.pdf[/url] The Datasheet specifies MSBFIRST and the allowable Clkin Freq is 400KHz to 2.5Mhz so I setup the "SpeedMulti" constant to 10 (10x83Khz = 830 Khz) I am thinking its the way Im sending the data to the SPI interface because I cannot get the /DRDY (Data Ready) pin to go LOW. Has anyone used this 16Bit A/D before with the SX? Any help is appreciated. Below is a sample of my code. Thanks DEVICE SX28, OSCHS3, TURBO, STACKX, OPTIONX FREQ 50_000_000 Dout PIN RB.0 OUTPUT ' Data TO MAX1416 (DIN) Pin 14 Cpin PIN RB.2 OUTPUT ' SCLK to MAX1416 (SCLK)Pin 1 Din PIN RB.1 INPUT ' Data from MAX1416 (DOUT) Pin 13 TX Pin RA.0 output ' Serial to PC Baud CON "T9600" ' BAUD for PC ComRegWRClk CON %00100000 '$20 ' CH1 ; Set Operation WR to Clock REG ClkRegWR CON %10100101 '$A5 ' INTCLK Frq 2.4576Mhz ; 60HZ Update ComRegWRSetup CON %00010000 '$10 ' Set Operation WR to Setup REG ComWRSetup CON %01000100 '$44 ' SelfCal ; Gain 0 ; UniPolar ; NoBuf ; Beg SelfCal Clear FSYNC ComWRComReg CON %1000 '$08 ' Set Operation Read from ComReg to see if DATA is ready! DataVar VAR Byte 'VAR for ShiftOutIn Command TX_BYTE SUB 1 PROGRAM Start Start: Main: pause 1000 SHIFTOUT Dout, Cpin, MSBFIRST, ComRegWRClk,10 SHIFTOUT Dout, Cpin, MSBFIRST, ClkRegWR,10 SHIFTOUT Dout, Cpin, MSBFIRST, ComRegWRSetup,10 SHIFTOUT Dout, Cpin, MSBFIRST, ComWRSetup,10 SHIFTOUT Dout, Cpin, MSBFIRST, ComWRComReg,10 SHIFTIN Din, Cpin, MSBPOST, DataVar,10 'TX_BYTE DataVar SEROUT TX, Baud, DataVar SEROUT TX, Baud, "M" goto Main SUB TX_BYTE SEROUT TX, Baud, __PARAM1 ENDSUB [1][/1] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=284611 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)