Shop OBEX P1 Docs P2 Docs Learn Events
PropView (the hump) — Parallax Forums

PropView (the hump)

yarisboyyarisboy Posts: 245
edited 2013-09-25 01:53 in Propeller 1
Every ViewPort example and tutorial works ok. When I do the recommended changes to my program ViewPort is acting like it doesn't exist. Com port ok, compiles without error. Loads without error. When I go to DSO I got buttkiss. When I go to configuration Viewport acts like I didn't put the vpshare statement in and doesn't key-up on shared variables. A "real-input" example is the microphone demo. OK what is that little arrow upward on the schematic with AC beside it mean? A demo or application where the Prop is instructed to generate its own outputs is all well and good but until I get this thing to display a real stimulus from the outside world I haven proven usfule yet. Does ViewPort not work at all with PST? I'm uploading my top (to this post) file in Spin. I haven't been on here for three years so I've forgotten how to archive all objects for a better upload. I looked for an archive in the save/save as buttons but didn't find it. I tried loading the compiled programs from ViewPort and from the prop tool. The PST works but ViewPort just doesn't like my code yet....or something

Comments

  • ratronicratronic Posts: 1,451
    edited 2013-09-22 13:15
    yarisboy your program is starting the Parallax serial terminal which uses the same USB connection as Viewport. I don't use the serial terminal while using Viewport.

    Edit: You cannot use any object or in your program that has anything to do with ports 30, 31 when using Viewport.
  • yarisboyyarisboy Posts: 245
    edited 2013-09-23 12:53
    Thanks. Here is a much simplified test program. (no pst) The first time I compiled and loaded it it let me configure the variables. Changing voltages going into the A/D chip still had no effect on anything in the DSO. The second time I tried all that, Viewport wouldn't even go into configure.
  • yarisboyyarisboy Posts: 245
    edited 2013-09-23 13:52
    I made another version with "Terminal" instead of "Conduit". There is obviously a lot missing from my code. Viewport gives me the option of editing variables like they are numbers I change within Viewport and send yo the prop instead of the desired readings I seek from the outside world. The MCP3208 should be returning integers from 0 to 4089. How I get ViewPort to grab onto those and show them to me is still a deep mystery.
  • yarisboyyarisboy Posts: 245
    edited 2013-09-23 13:55
    Could this POC OS (Windows 8) on my desktop be the problem?
  • ratronicratronic Posts: 1,451
    edited 2013-09-23 14:39
    I just tried the last code you posted and it works here. I am using Windows 7. Support for Viewport is now @ onerobot.org. I tried it on a Propeller Protoboard that has a MCP3208 and only changed the port#'s in the CON section to match my setup.
  • yarisboyyarisboy Posts: 245
    edited 2013-09-23 19:23
    Thanks Dave. Hanno worked with me too a bit today. I swapped in a new 40-pin dip. No joy. I've ordered a new Prop Project Board USB. The old Spin Studio has been knocked around and possibly ESDed for too many years. It didn't work on the legacy XP machine either one must keep for really old apps.
  • ratronicratronic Posts: 1,451
    edited 2013-09-23 19:50
    Now that you have Hanno's ear you will get it working. But I have to admit I'm not a Viewport expert. I really like Viewport and I have used it to adjust P.I.D. variables live and use the DSO to see variables live.
  • yarisboyyarisboy Posts: 245
    edited 2013-09-24 09:13
    Yes, with Hanno and Dave on my tag team we solved this one. First I had to cut up my oldest Propeller to prop stick cable. (I have two more) Second I had to correct my CON block where I specify the Propeller pins used to communicate with the MCP3208. The hardware board (now obsolete) from uController.com (Spin Studio) had a hardware quirk in the layout. It's good to know I can still use the old hardware to develop code while the new boards come in. Find the corrected spin code attached. It's not OBEX ready yet but I'm working on it.
  • ratronicratronic Posts: 1,451
    edited 2013-09-24 10:48
    I added an adjustable variable "index" to your code for an example of how I do it. When you run this with Viewport and go to the DSO tab it will show all three variables on the scope and also have a slider to adjust "index". You can change the limits of "index" in

    appropriate configuration strings. Hope this helps.
    {{                                                                                                    
    File: MCP3208_vpDEMO.spin                                                                             
    Author: Mike Rector, KF4IXM                                                                           
    Version: 1.0                                                                                          
    Copyright (c) Mike Rector, KF4IXM                                                                     
    See end of file for Terms of Use.                                                                     
    }}                                                                                                    
                                                                                                          
    {{                                                                                                    
    This demo demonstrates the Microchip MCP3208 8 channel adc chip connected to the Parallax             
    Propeller Demo Board. It uses the MCP3208.spin object Written by Chip Gracey and outputs the adc      
    value (0-4096) of all 8 channels (labeled as 0-7) in Parallax Serial Terminal.                        
    The Datasheet of the MCP3208 can be found here:                                                       
    [URL]http://ww1.microchip.com/downloads/en/devicedoc/21298c.pdf[/URL]                                            
    Connect both AGnd (pin 14) and DGnd (pin 9) of the MCP3208 to the Vss of the demo board.              
                                                                                                          
    MODIFIED & RENAMED 9/23/2013 TO TEST ViewPort (Stan Cloyd)                                            
    }}                                                                                                    
                                                                                                          
    CON                                                                                                   
        _clkmode = xtal1 + pll16x                                                                         
        _xinfreq = 5_000_000                                                                              
                                                                                                          
    OBJ                                                                                                   
    adc     : "MCP3208"                                                                                   
    vp      : "Conduit"                                                                                   
                                                                                                          
    CON                                                                                                   
    diopin = 1       'both din and dout of the mcp3208 are connected to this pin on the prop demo board.  
    clockpin = 0       'the clock pin of the mcp3208 is connected to this pin on the prop demo board.     
    cspin = 2       'the chip select pin of the mcp 3208 is connected to this pin on the prop demo board. 
                                                                                                          
    VAR                                                                                                   
      long vbat, cbat, index                                                                              
                                                                                                          
    pub View                                                                                              
    vp.config(string("var:vbat,cbat,index(min=0,max=1000)"))                                              
    vp.config(string("lsa:view=vbat"))                                                                    
    vp.config(string("dso:view=[vbat,cbat,index],bgnd=yellow,timescale=10ms"))                            
    vp.config(string("edit:index(default=500,mode=[scroll,text])"))                                       
    vp.config(string("start:code"))                                                                       
                                                                                                          
    vp.share(@vbat,@index)                                                                                
    adc.start(diopin, clockpin, cspin, 255)  'Start the MCP3208 object and enable all 8 channels as       
                                      'single-ended inputs.                                               
    repeat                                                                                                
      vbat:=adc.in(0)                                                                                     
      cbat:=adc.in(7)
    
  • HannoHanno Posts: 1,130
    edited 2013-09-25 01:53
    Yarisboy just sent me a photo of the reason why he was having problems- turns out it was the infernal retractable USB cable that Parallax used to ship with their products. Thankfully (after much prodding) they're no longer shipping it, but I wish they had done more to inform their customers about the problem. I'm convinced that scores of customers have given up on otherwise great products because of reliability problems caused by a faulty cable.

    Please, if you're using a retractable USB cable, THROW it out! It does not comply with the USB standard and does not work! If you want more background on why it may appear to work initially when transferring very small amounts of data for short periods of time- but fails otherwise, please search the forums for my previous rants.
    Hanno
Sign In or Register to comment.