Shop OBEX P1 Docs P2 Docs Learn Events
max1272 and spi — Parallax Forums

max1272 and spi

SawmillerSawmiller Posts: 276
edited 2006-07-12 15:54 in Propeller 1
hi all,
tring to interface a max1272 to the prop... keep getting a 0 signal... the question i have is it is using a serial clock in its data sheet, and the timing diagram shows sclk continuing to run between data in and data out... do i need to use a seperate cog to run a sclk ? or what? i'm tring to redo the ds1620.spin to work with this ADC chip. been looking at the datasheet for several days , but a lot of it is greek to me
( and i'm not greek )
dan

Comments

  • bambinobambino Posts: 789
    edited 2006-07-10 18:24
    Sawmiller,

    I not qualified to spin a proppeller yet, but I have worked with the Max1270 a lot. It's very similar to the 1272 you have.(just a little faster and more fault tolerant). There stamp code on how to generate one conversion in the link under the stamp PLC( in the industrial section).http://www.parallax.com/detail.asp?product_id=30064

    ·However without the stamps Shiftin and shiftout commands they are a little touchy.

    If you have a 1270 I could help you more as they generate a framesync pulse usefull in retrieving the output.(Plus with a continuous clock capacitance at the input is kept to a min making offset's less needed in some app's.
  • SawmillerSawmiller Posts: 276
    edited 2006-07-10 19:12
    i have a few 1270's also they have 8 inputs vs the 1272's 1 so i am just saving them for more analog inputs, but if i cant figure it out i will use them... thanks for the tip as to the plc bs2 file.. that should make it easier, cause i can emulate stamp commands whith the bs2_functions library.. i think

    dan
  • SawmillerSawmiller Posts: 276
    edited 2006-07-11 14:01
    couldnt make the max 1272 work, so i'm using the 1270 with the bs2_functions library, works ok.... lots of difference in the readings thou, 200 or so, will have to redo breadboard to try to minumize length of runs and points where wires cross
    but at least it responds to the linear transducer 0- 10v signal
  • bambinobambino Posts: 789
    edited 2006-07-11 16:14
    Where you able todo a single conversion? If so how many clk's?
  • SawmillerSawmiller Posts: 276
    edited 2006-07-11 21:48
    i redid my breadboard, nice wiring now, but i still am getting readings that vary by too much.. have to start again with the programming end i thinka jitter of 2-3 would be ok, but 100 - 200 is too much on a 12 bit setup, i've even tried averaging 100 samples, still too much jitter. back to drawing board..

    but yes , it does work , if i pull the rod out to around 46" i get readings in the 3600 range, all the way in gives 0 or so, it looks linear, just unexceptable jitter... maybe its in the time of the sample..

    dan

    ps doing about 100 samples per sec... nowhere near straining the ADC i think, but i cant read them any faster anyways...( old eyes )
  • SawmillerSawmiller Posts: 276
    edited 2006-07-12 03:08
    Got it !
    the 1270 pdf file didnt have it , but in N&V 105 they showed a capacitor from ref and refadj to ground...
    did the ref to ground with a 10 uF and presto... no jitter.. heres the latest spin bambino
    prop to 1270 to 0 - 10 VDC linear transducer
    measures 0 to 48 inches to within a 32nd, good enuf for the sawmill
    now to do the motor controls and settings
    dan
  • bambinobambino Posts: 789
    edited 2006-07-12 15:54
    I know what you mean by the vision thing. Try a running avrg @ a faster clk and use a timer to spit out your reading whenever you need an update. Just remember to add 1 to your result if your holding variable is initialized at 0.

    avg = 0

    main:

    avg = ((avg+ADCreading)/2)

    If timer then print (avg + 1)

    goto main

    Glad to hear you got it going.
Sign In or Register to comment.