Shop OBEX P1 Docs P2 Docs Learn Events
Viewport problem - Affecting i/o pin. — Parallax Forums

Viewport problem - Affecting i/o pin.

FORDFORD Posts: 221
edited 2012-10-23 17:46 in Propeller 1
Hi All,
I posted this question on the viewport forum but things are a bit quiet over there, so thought I would try the guru's here...

I've written some pulse counting code, which writes to a 4x20 lcd, and also has 2 push button switches to enter a menu and increment values.

I'm using Viewport object "Conduit.spin" version 1/2012.

The code runs fine, and is very stable... until I try to run viewport...

== The problem...
As soon as i enable the vp.share line, code runs up to the point where it thinks I've pressed the button on i/o 15, (other i/o pins dont seem to be affected).
I have found that Viewport is pulling the i/o pin low and holding it there, so then other cogs now see that the switch on i/o 15 has been pressed.
(Note - I do have a 4k7 pullup on i/o 15 and it is declared as an input in each cog / method that looks at that pin.

== Tests I have done repeatedly...
-Running the code without the vp.share line enabled, it runs perfectly.
-Enable the vp.share , but then disabled the 'start' method call in 'conduit.spin' at line No 43, and my software then runs fine, so it appears that the pasm code in the conduit object pulling it low.
-Other input pins are unaffected.
-I have plenty of stack space for each of the 4 cogs I'm running.
-This occurs just using the propeller tool, without the Viewport software running, so its definitely in the conduit.spin object (as far as I can tell anyway).
-Voltage checks on the i/o pin confirm the above.
-Changed prop dip chip 'just to try that'.
-Checked i/o pin assignments in each method using that pin.

I can probably just change i/o pin assignments, but that wont actually tell me whats wrong here.
(in fact theres another thing for me to check tomorrow)

Anyones thoughts would be appreciated

cheers,
Chris

Comments

  • PublisonPublison Posts: 12,366
    edited 2012-10-20 16:10
    Have you tried upgrading to 4.7.8? The last conduit was dated 8.2.12.

    I don't see any upgrades specific to conduit..but there have been some "bug fixes" in the past few months, although conduit has been pretty solid.

    Any code you want to share, or just the conduit calls?
  • FORDFORD Posts: 221
    edited 2012-10-20 16:40
    Hi Publison,
    Thanks for your reply, I'm using 4.7.8 but the conduit.spin file has 1/2012 marked at the top ?

    I wont publish code yet until I just check this on another i/o (cant do that until tomorrow).
    I have to be careful as the software I am doing is for a client who I have non disclosure agreements with and they own the code, otherwise I would have posted it initially.

    I'll also do a smaller program more basic and see if I can get the same thing to happen.

    Cheers,
    Chris.
  • PublisonPublison Posts: 12,366
    edited 2012-10-20 16:43
    FORD wrote: »
    Hi Publison,
    Thanks for your reply, I'm using 4.7.8 but the conduit.spin file has 1/2012 marked at the top ?

    I wont publish code yet until I just check this on another i/o (cant do that until tomorrow).
    I have to be careful as the software I am doing is for a client who I have non disclosure agreements with and they own the code, otherwise I would have posted it initially.

    I'll also do a smaller program more basic and see if I can get the same thing to happen.

    Cheers,
    Chris.

    Roger that.
  • FORDFORD Posts: 221
    edited 2012-10-22 03:40
    Well, I tested this morning...

    - Swapped pin assignments to my 2 push button switches, and i/o 15 was still being pulled low.

    - So then I connected the pull-up resistor and switch to another i/o, and all works fine, but it was still pulling i/o pin 15 low, even though nowhere in my program it no longer operates or assigns anything to that i/o pin.

    So the conduit object is definitely pulling i/o pin 15 low.

    I'm using the conduit.spin file that came with the latest software I downloaded last week.

    Hanno, if you're out there mate, please respond.

    Cheers,
    chris
  • StefanL38StefanL38 Posts: 2,292
    edited 2012-10-22 03:57
    Hi Chris,

    did you do a byte for byte comparising of your conduit-object with a version that is fresh downloaded?

    best regards
    Stefan
  • FORDFORD Posts: 221
    edited 2012-10-22 04:00
    Hi Stefan,
    No, but I probably should have, thats a good idea.
    I have searched hannoware site to try and ensure I get the latest, but cant find a link to a fresh conduit.spin file.
    I'm presuming you just get it when you download the software.

    I'll search there again now...

    Thanks for your suggestion...
    Cheers,
    Chris
  • MicksterMickster Posts: 2,694
    edited 2012-10-22 07:21
    I recently purchased a license for VP but the version I then downloaded was waaay out of date.

    I'm having my own issues with this software. It seems that watching variables is not 100% reliable.

    Mickster
  • PublisonPublison Posts: 12,366
    edited 2012-10-22 08:11
    Mickster wrote: »
    I recently purchased a license for VP but the version I then downloaded was waaay out of date.

    I'm having my own issues with this software. It seems that watching variables is not 100% reliable.

    Mickster

    @Mickster,

    The latest version can be gotten here:
    http://forums.hannoware.com/viewtopic.php?f=4&t=72&sid=7d171f62fe568d2b6bb1e4eb4c708766

    You must have gotten Ver 4.5.2 from the Parallax site?

    Current Version is 4.7.8
  • MicksterMickster Posts: 2,694
    edited 2012-10-23 03:05
    Ah, thanks. This was actually pointed-out by another forum member when I complained about it at the time. The VP that I downloaded actually came from Hannoware.com, strangely enough.

    Regards,

    Mickster
  • FORDFORD Posts: 221
    edited 2012-10-23 04:23
    Hi Mickster,
    Yes I'm having a few issues too, including no i/o pin status coming through, parallel display goes feral when I connect to viewport, plus the i/o problems I've mentioned here, am wishing Hanno was monitoring the forums, and hoping he's just on holidays or something.

    After paying the $$ for the software I'm getting slightly frustrated with it, but it could still be an issue with something I've done.

    I guess I'm saying I need Hanno's support here, and fairly soon I hope.

    Cheers, Chris
  • HannoHanno Posts: 1,130
    edited 2012-10-23 12:02
    Hi,
    I've aged 10 years in the last couple months due to a ruptured disk and pinched nerve in my back, but I'm slowly recovering. Sorry that it's taken a couple days to respond, but I'm sure we'll resolve the problem quickly now.

    I would be very very surprised if conduit affected pin 15. I've just looked through the code and can't see any way, short of code being corrupted, that the cog running conduit would affect other pins.

    I do have an idea that might explain what you're seeing.

    First some background:

    ViewPort supports 3 modes: Load, Run and Debug:
    -Load compiles your exact code with the Homespun compiler and loads it to the Propeller. You should see exactly the same behavior as with Propeller Tool
    -Run will first add the "conduit" object to your code (if it isn't already) and will then compile/load the result to the Propeller and then establish a connection with your code. Since the conduit is running in a separate cog, your code should run exactly as before, but one of the 8 cogs will stream data to/from the PC for real-time graphing and monitor/changing variables.
    -Debug will add "conduit" to your code (if it isn't already) AND will instrument your code for debugging. This changes your code by making it run slower and consume more memory, but gives you the benefit of stepping through code one line at a time, seeing performance statistics, and setting breakpoints. Debuggers for other processors have similar affect on code.

    If your code relies on very exact timing (such as video being generated or pins being bit-banged) then I recommend running that code in a cog that's not being Debugged- or to use the Run mode.

    If you're not using "Debug" mode, then I can be the most help if you:
    - tell us more about your hardware, ideally a schematic and photo of your setup
    - share or private message at least some of your code so I can try to replicate your issue
    - keep simplifying your program to isolate the problem

    Hanno
  • FORDFORD Posts: 221
    edited 2012-10-23 15:39
    Hi Hanno,
    Thank you for your response.
    I mentioned that I hoped you were on holidays or something, meaning that I hoped you weren't ill or worse, sorry that your back is bad, I have had the same thing so can fully sympathise with you.

    It could be the debug mode causing the issue, from reading your reply.

    I will go through a few of those things that you have mentioned.

    So what mode would I need to use to simply display the variables, and view i/o pin status ?
    No matter what mode I try and run, the i/o status does not show up on the graphic in Viewport.

    If I start at this level I will be in a better position to diagnose this issue.

    Cheers,
    Chris
  • HannoHanno Posts: 1,130
    edited 2012-10-23 16:26
    Hi Chris,
    Here's some code I just typed into ViewPort:
    var
      long out   'data sent out
      long inp  'result decoded in pasm
    pub main
      cognew(@input, @inp)
      repeat
        repeat out from 0 to 10
          send(out)
          waitcnt(cnt+clkfreq)
    pub send(x)   'output 24 bits using p3,p9,p10
      dira[3]~~
      dira[9..10]~~
      outa[3]~~   'indicated 24 bits are coming
      repeat 24
        if(x & (1<<23)) 'ready data bit
         outa[10]~~
        else
         outa[10]~
        x<<=1
        outa[9]~~  'pulse data is there bit
        outa[9]~
      outa[3]~
    

    I then press "Run" to display variables and view i/o pin status.
    See http://forums.parallax.com/showthread.php?143171-My-1st-PASM-Snippet-(which-doesn-t-work).-Help&p=1136685&posted=1#post1136685
    for some screenshots.

    Hanno
  • FORDFORD Posts: 221
    edited 2012-10-23 17:46
    Cheers Hanno,

    I'll have a look at that sample you've given me when I get a minute, and see what goes from there.

    I'm still new with propeller as well so lots to take in.

    I also think that the fact that I have some of my display writing stuff in the same code might be the issue as you've said in debug mode.

    I've got to finish this project now, so will do that, but then will move the display stuff to another object and go thru this again,

    thanks Hanno,

    (just notice you're a Kiwi, maybe a sidebet on the next Bledisloe Cup?)

    cheers,
    Chris
Sign In or Register to comment.