Going Loopy - How do i get my Loops sorted out ???


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Jul 2008
    Posts
    38


    Did you find this post helpful? Yes | No

    Smile

    Thanx for that, but isn't that doing the same as my original code???
    Doesn't it flow down into the next label (GetData) and execute thsoe commands as previously?).

    Anyway, i tried it, and it's still the same, except now the SAME digit appears on both 7-Segs during each keypress in Hyperterm.

    I know this code is probably only missing 1-2 lines, or a nested loop somewehre, it's probably so obvious that i still can't see it

    Marty.

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by gtvmarty View Post
    Thanx for that, but isn't that doing the same as my original code???
    Doesn't it flow down into the next label (GetData) and execute thsoe commands as previously?).
    No, I have it reading the serial once not twice. I was thinking in your example you were sending 23. But after rereading you are sending 2 and then 3. So you want to read the serial twice. Sorry.

    Try adding a time out to the serin command, if no serial data comes in after a certain amount of time the code will go to the display routine to light the LEDs up. Then go take a quick look for some serial data.
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Jul 2008
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    Thanx, i'll keep digging......

  4. #4
    Join Date
    Jul 2008
    Posts
    38


    Did you find this post helpful? Yes | No

    Default

    Update:

    After sorting out my SerIn problem (i didnt know SerIn waits for eternity until data arrives), I managed to get my Serial to 7-seg project 'roughly' work.

    However, due to to the time it takes to read/wait for SerIn data and go back to multiplex the 7-seg displays, i dont think this will EVER work in the correct fashion i anticipated.
    If i shorten the timeout on SerIn then i miss incoming data, if i lengthen the timeout to get data, then the 7segs are too flickery.
    With several adjusments, i have PERFECT 7seg multiplexed displays but with no ability to read SerIn data.

    So, I don't think i have any option but to upgrade to a Pic'877 (i have a boxful) and use 2 ports for the 2x 7seg displays, where they can hold LATCHED data onto the 7segs, whilst the SerIn can be left to sit for eternity waiting for new data without upsetting the 7seg displays.


    I encourage anyone who thinks they can make it work to prove me wrong

    Regards,
    Marty.

  5. #5
    Join Date
    Nov 2005
    Location
    Bombay, India
    Posts
    969


    Did you find this post helpful? Yes | No

    Default

    Marty

    I do not want to take up your challenge, but, have you considered putting the display update to be on RTCC interrupt? Solves all your problems of serin waiting.

  6. #6
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by gtvmarty View Post
    Update:

    After sorting out my SerIn problem (i didnt know SerIn waits for eternity until data arrives), I managed to get my Serial to 7-seg project 'roughly' work.

    However, due to to the time it takes to read/wait for SerIn data and go back to multiplex the 7-seg displays, i dont think this will EVER work in the correct fashion i anticipated.
    If i shorten the timeout on SerIn then i miss incoming data, if i lengthen the timeout to get data, then the 7segs are too flickery.
    With several adjusments, i have PERFECT 7seg multiplexed displays but with no ability to read SerIn data.

    So, I don't think i have any option but to upgrade to a Pic'877 (i have a boxful) and use 2 ports for the 2x 7seg displays, where they can hold LATCHED data onto the 7segs, whilst the SerIn can be left to sit for eternity waiting for new data without upsetting the 7seg displays.


    I encourage anyone who thinks they can make it work to prove me wrong

    Regards,
    Marty.
    Hi Marty,
    There's a lot of real estate between old grandpa F84 and an F877, despite your boxful of them . . . a 16F648A has the same footprint and pin orientation as the F84 with tons of memory and an USART to use HSERIN, and it's much simpler to breadboard. Then you don't have all those timing issues (as with grandpa). Sure Electronics has some nice SPI type 7 segment displays and some dot matrix types too (available direct or through eBay). Use 'em with old GrandPa too.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. 4 Channel Thermostat using PID loops
    By malc-c in forum Code Examples
    Replies: 36
    Last Post: - 18th March 2013, 11:17
  2. Breaking out of for loops
    By Kamikaze47 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 17th March 2008, 01:49
  3. For Next Loops and Serin2?
    By scottl in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th November 2007, 21:28
  4. Proximity detection - tuned loops
    By George in forum Off Topic
    Replies: 1
    Last Post: - 31st July 2007, 18:25
  5. Help with loops..
    By xobx in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 13th July 2007, 23:17

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