Where am i going wrong?


Closed Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2007
    Location
    england
    Posts
    15

    Default Where am i going wrong?

    Hi again all.
    Many thanks for your previous help. Below i have listed my serin code and it reads the ir and works well except for it does not jump to the listed label after the timeout. I know its probably obvious but ive been staring at the code for hours and cant see where im going wrong, could anyone please advise me on why?

    IRIN:
    Serin portb.0,N2400,200,TOUT,B0 ' B0 = input character
    If (B0 = "A") or (B0 > "0") Then call IRHIT ' If lower case, convert to upper
    goto IRIN


    IRHIT:
    high portc.0
    goto GAMEEND

    TOUT:
    high porta.6
    pause 5000
    low porta.6

    This is only a section of my overall code but it is as far as i can see the only part that has anything to do with the serin part of the program.
    After i have completed the program i will post the full code and circuit schematics.

  2. #2
    Join Date
    Feb 2003
    Location
    Salt Lake City, Utah USA
    Posts
    517


    Did you find this post helpful? Yes | No

    Default

    >> If (B0 = "A") or (B0 > "0") Then call IRHIT ' If lower case, convert to upper

    without seeing more, try

    If (B0 = "A") or (B0 > "0") Then IRHIT ' If lower case, convert to upper
    Paul Borgmeier
    Salt Lake City, UT
    USA
    __________________

  3. #3
    Join Date
    Jun 2007
    Location
    england
    Posts
    15


    Did you find this post helpful? Yes | No

    Default Didnt Make A Differance

    thankyou for your suggestion. i tried it but it didnt change a thing. The program is supposed to jump to TOUT after 200ms if it doesnt recieve a valid serial command. any help or suggestions would be great. Ive checked the pbp manual but it shows the command how ive written it but i am getting no joy.
    thanks in advance for all help.

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


    Did you find this post helpful? Yes | No

    Default

    Most problem with timeout is the Idle state of your Serial PIN. If it doesn't match, it will never execute the Timeout.

    What you can do, is to leave your serial pin floating, test it with a pull-up, then pull-down... see which one allow Timeout to work. Inverted mode should idle low. True mode should idle high.
    Steve

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

Similar Threads

  1. LCD Showes Some Wrong Letters
    By sbobowski in forum General
    Replies: 2
    Last Post: - 23rd September 2008, 19:15
  2. Anyone know whats wrong with this code
    By Bonxy in forum Serial
    Replies: 10
    Last Post: - 9th March 2007, 16:29
  3. ADCIN - AD settings are wrong
    By teverett in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 4th December 2006, 16:32
  4. What am I doing wrong?
    By mankan in forum General
    Replies: 1
    Last Post: - 23rd June 2006, 19:03
  5. HDD IDE ATA 2 interface problems. code wrong?
    By rastan in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th March 2005, 16:01

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