Getting Stuck in loop


Closed Thread
Results 1 to 23 of 23

Hybrid View

  1. #1
    Join Date
    Aug 2008
    Posts
    39


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    How neat the signal on PORTA.5 is? Where this signal come from?
    Looking at the signal in question on an o-scope, It looks pretty clean to me. It is connected to a 100K pull-up to 5V. The transition from high to low does have some ringing , that lasts about 90nS give or take, but the peaks are all < 0, so it should still be seen as a low.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Reduce it!!! Let's say ~1-10K pull-up.

    AND, wait a few Usec after you detect the falling edge...
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Aug 2008
    Posts
    39


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    Reduce it!!! Let's say ~1-10K pull-up.

    AND, wait a few Usec after you detect the falling edge...
    Wiat let me correct that... I just looked at the schematic, there is not a pull up on PortA.5. Sorry about that, I did not do the hardware, I am just doing the programming.


    I have a 3uS pause after the falling edge (was 1uS, but Alain correct me on that already)

    Thanks for all your help so far guys...

    I am still learning this digital stuff, and have been slowly making my way up the hill.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default

    A floating input would for sure screw-the-pooch since it returns a random value when
    the port pin is read...;o}
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  5. #5
    Join Date
    Jan 2006
    Location
    Istanbul
    Posts
    1,185


    Did you find this post helpful? Yes | No

    Default

    Looking at the first post,

    I think this could be the issue here.

    Code:
    X var PORTA.5
    Y var PORTF.6
    
    
    REPEAT
    UNTIL x = 0  ' X = 1 ;  wait until it is 0.
    
    High y       ' Here, X = 0.
    
    while x = 0 : wend  ' Here, X = 0, wait until it is 1.
    
    REPEAT
    UNTIL x = 0  ' X = 1 ;  wait until it is 0. 
            Pauseus 1
    		Location1=PortJ
    
    while x = 0 : wend  ' Here, X = 0, wait until it is 1.
    
    
    REPEAT
    UNTIL x = 0         ' X = 1 ;  wait until it is 0. 
            pauseus 1
    		CharLow=PortJ
    
    while x = 0 : wend  ' Here, X = 0, wait until it is 1.
    
    REPEAT
    UNTIL x = 0
            pauseus 1
    		CharHigh=PortJ
    		
    while x = 0 : wend  ' Here, X = 0, wait until it is 1.

    ------------
    "If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte

  6. #6
    Join Date
    Aug 2008
    Posts
    39


    Did you find this post helpful? Yes | No

    Default

    sayzer:

    I'll give it a try and see if that helps...

  7. #7
    Join Date
    Aug 2008
    Posts
    39


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Frozen001 View Post
    sayzer:

    I'll give it a try and see if that helps...
    I made the change and it made no difference at all.

Similar Threads

  1. Controlsystem for compact sporting (clay shooting)
    By Fredrick in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 30th July 2009, 16:48
  2. Avoiding getting stuck in a loop
    By AndrewC in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 31st July 2008, 11:41
  3. Serin to Serin2 ??
    By Gixxer in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th January 2008, 03:56
  4. Serial Relays
    By tazntex in forum General
    Replies: 3
    Last Post: - 17th May 2007, 17:42
  5. Newbie question:
    By Izone in forum mel PIC BASIC
    Replies: 2
    Last Post: - 26th February 2006, 16:24

Members who have read this thread : 0

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