Shop OBEX P1 Docs P2 Docs Learn Events
Problems with MCP3202 driver — Parallax Forums

Problems with MCP3202 driver

John AbshierJohn Abshier Posts: 1,116
edited 2009-09-25 19:23 in Propeller 1
I tried to use Chip's MCP3202 driver with ViewPort and ViewPort would not start.· I found a problem with the MCP3202 driver.· The assembly code reads 5 longs for parameters but the Spin code only sets up 4 longs.· If I comment out this code, ViewPort works, but DAC functionality is lost.

{                        call    #param                  'setup DAC configuration
        if_c            or      dira,t2
        if_c            movs    ctra,t3
        if_c            movi    ctra,#%00110_000
                        shr     t3,#8
                        call    #param2
        if_c            or      dira,t2
        if_c            movs    ctrb,t3
        if_c            movi    ctrb,#%00110_000        }



John Abshier

Comments

  • HannoHanno Posts: 1,130
    edited 2009-09-25 19:11
    Thanks for posting John.
    I believe what's going on is that DIRA is set to a value that affects pins 30 and 31- which ViewPort requires for serial communication. This is the beauty of the Propeller- programs running in different cogs really shouldn't affect each other- apart from shared resources like global memory and the IO pins.

    The most common problems users have with ViewPort are:
    - not setting the timing constants correctly- this causes the conduit to send data at an incorrect baud rate
    - using pins 30 and/or 31 in their own program- this prevents the conduit from sending/receiving data.
    - not using the vp.share statement- so the conduit never runs

    Best thing is to give the included tutorials a try and maybe even explore that book written by that spanish guy- manuel? Manual?
    Hanno

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Download a free trial of ViewPort- the premier visual debugger for the Propeller
    Includes full debugger, simulated instruments, fuzzy logic, and OpenCV for computer vision. Now a Parallax Product!
  • John AbshierJohn Abshier Posts: 1,116
    edited 2009-09-25 19:19
    Hano, I am sure that dira is getting clobbered when the MCP3202 driver reads the 5 parameter. Since my present need does not require DAC, commenting out the DAC setup is a quick fix. When I need DAC as well as ADC, I will do a proper fix if Chip has not already done so. I am going to visit the grandkids so I won't be doing anything with the Propeller for 3 or 4 days.

    John Abshier
  • HannoHanno Posts: 1,130
    edited 2009-09-25 19:23
    Enjoy the grandkids!
    Hanno

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Download a free trial of ViewPort- the premier visual debugger for the Propeller
    Includes full debugger, simulated instruments, fuzzy logic, and OpenCV for computer vision. Now a Parallax Product!
Sign In or Register to comment.