Select Case Weirdness


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default Re: Select Case Weirdness

    OK, If thats the case,"routine is only called when there is a valid (dtmf decode ) data ready to analyse" then whats the problem?
    Dave Purola,
    N8NTA
    EN82fn

  2. #2
    Join Date
    Jan 2005
    Location
    Montreal, Quebec, Canada
    Posts
    3,172


    Did you find this post helpful? Yes | No

    Default Re: Select Case Weirdness

    Pretty sure Richard is right. They were valid codes.

    Notice I put a "Pause 1000" into all the conditions that previously didn't have code - this line of code appears to stop this weird behavior from occurring

  3. #3
    Join Date
    Dec 2010
    Location
    Melbourne Australia
    Posts
    172


    Did you find this post helpful? Yes | No

    Default Re: Select Case Weirdness

    Thanks for all the help guys - seriously appreciated! I found the error and yes indeed it wasn't with the select case at all. The cause: I was receiving a DTMF tone through a dedicated DTMF receiver IC which required a polling of a status pin which would trigger my code to shift out the tone value from the receiver IC in 4 bit format. Problem for me was that initially that value would be correct (as my debugging highlighted) and the select case was receiving this expected value (which my testing highlighted), but because there was no pause in the code anywhere for many tones, the code would go straight back to polling and receiving right after the select case execution which turned out to be too fast and the "tone value" register in the receiver IC must default to 15 after being read. Because the status pin still flagged a valid tone receive, my code would read this value (15) and act on it with the "select case" code in question and my output (a light globe for testing purposes) would only visibly display the result of the "15" value every time thereby leading me to erroneously assume the select case was causing the issue. Duh - apologies for any time wasted.

    Thanks again,

    Troy

Similar Threads

  1. Changing from If..Then to Select Case
    By BobK in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 27th March 2013, 12:06
  2. About Select Case
    By polymer52 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 28th February 2010, 12:54
  3. Help needed with Select Case?
    By jessey in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 2nd January 2008, 01:12
  4. Select case...Just wondering....
    By muddy0409 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 30th December 2006, 00:23
  5. Select Case
    By Srigopal007 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 20th June 2005, 20:18

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