Shop OBEX P1 Docs P2 Docs Learn Events
LTC1298 with SX integration — Parallax Forums

LTC1298 with SX integration

DJFXDJFX Posts: 15
edited 2005-11-22 16:17 in General Discussion
I'm fairly new to the world of microcontroller's and would like some assistance in converting some code if possible. I·would like to use·the LTC1298 12-bit ADC with the SX28.· I used it with the BS2 but need it to work with the SX because of PCB size constraints, SX28 being smaller than the BS2.· The code for the BS2 is shown below and I have put an (*) next·to what I don't understand is happening and·how it correlates to the SX.· Thanks in advance for the assistance.

CS············ PIN···· 2
CLK··········· PIN···· 1
DIO_n········· PIN···· 0

adc··········· VAR···· Word(2)

config········ VAR···· Nib
startB········ VAR···· config.BIT0 *
sglDif········ VAR···· config.BIT1 *
channel······· VAR···· config.BIT2 *
msbf·········· VAR···· config.BIT3 *

HIGH CS
HIGH DIO_n

DO
· DEBUG HOME
· FOR channel = 0 TO 1
··· GOSUB convert
··· DEBUG "channel(", DEC1 Channel, "): ", DEC4 adc(channel) ,CR
··· PAUSE 500
· NEXT
LOOP

convert:
· config = %1011 | config·*
· LOW CS
· SHIFTOUT DIO_n,CLK,LSBFIRST,[noparse][[/noparse]config\4] *(only the·[noparse][[/noparse]config/4] part)
· SHIFTIN DIO_n,CLK,MSBPOST,[noparse][[/noparse]adc(channel)\12]
· HIGH CS
· RETURN

Comments

  • Mike CookMike Cook Posts: 829
    edited 2005-11-22 05:42
    Take a look at this post for an example of using the LTC1298 with SX/B:

    http://forums.parallax.com/showthread.php?p=555332

    look for the file attachment of LTC1298.SXB

    If your working with assembly you can compile this program and use the <CTRL><L> to see the assembly output.


    Mike

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "OEM NMEA GPS Module" Now available on ebay for only $19.99

    Product web site: http://www.allsurplus.net/Axiom/

    Post Edited (Mike Cook) : 11/22/2005 6:18:58 AM GMT
  • DJFXDJFX Posts: 15
    edited 2005-11-22 16:17
    Cool, thanks for the help.· I greatly appriciate it.· I let you know when it works.· Thanks again.
Sign In or Register to comment.