Debug in + Floating pin = stop program execution?


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2005
    Posts
    44

    Default Debug in + Floating pin = stop program execution?

    I have a picbasic program that with some intermediate testing seemed to work well, however, when the serial interface cable was removed, the program would intermittantly halt, where the debigin command is:

    A snip of the code is below:

    Code:
    DEBUGIN 10000,runmode,[WAIT("x"), TriggerChar]	' TriggerChar = X
    			
    If TriggerChar = "x" then GOTO Setup
    
    runmode:
    SerOut So, N9600, [27,"[2J"]				' Clear Terminal Screen						' Output
    SerOut So, N9600, ["Entering Run Mode, Disconnect Programming Cable."]	' Output
    pause 500
    What happens is when the serial cable between the pic pcb and PC is removed, the program will stop around the debugin command, however the debugin pin is floating (only an 18k resistor in series with the DB9 pin socket.

    Tying the pin low (via another resistor) seems to correct the issue, however scoping the pin without the resistor shows less than 5mv fluctuation on the pin - is this enough to cause the issue?

    Should i tie the pin low with a 47k resistor or is my problem somewhere else?
    Do i also need to tie all unused pins low, or is it simply ok to have them set as outputs?
    Last edited by jamie_s; - 9th November 2005 at 07:15.

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Unless the pin is held low during either no connection or periods of data idle, the software will never time out... even an odd pulse of random noise will be enough to keep resetting the timeout and your program will appear to hang at that statement. Your scopes probe (even on x10 setting) is probably enough to drag the pin low and give a false impression that you only have a few mV of input... if you really want to know the truth (can you handle it?) put a good quality VVM on the input pin and look at the horror story of what it's really doing...

    As one solution (of many approaches), see also http://www.picbasic.co.uk/forum/show...=9765#post9765

Similar Threads

  1. RS485 bus - starting probem
    By wurm in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 27th January 2010, 13:35
  2. LCD will not start
    By btaylor in forum mel PIC BASIC Pro
    Replies: 49
    Last Post: - 24th May 2007, 02:30
  3. Help with CC1100 RF Modules.
    By charudatt in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 27th November 2006, 20:58
  4. A little DTMF help
    By Travin77 in forum mel PIC BASIC Pro
    Replies: 48
    Last Post: - 30th May 2006, 01:31
  5. New member
    By jmgelba in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 28th February 2004, 22:44

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts