does this piece of code look ok?


Results 1 to 27 of 27

Threaded View

  1. #5
    Richardco's Avatar
    Richardco Guest


    Did you find this post helpful? Yes | No

    Angry

    Im sorry for starting two threads but i began the first one in the wrong place and i saw a comment from someone regarding posting in the correct place so i changed it to here, Next the suggestion that you provide me with the completed piece of code was not a serios one as i would have thought the tone of the following statement in the post would have suggested, getting a ready built piece of code is not what i am after at all as this would teach me nothing.

    Now in the post that i started in the wrong place there is a picture, this picture shows that i do not wish to use more than one chip.

    so i assumed that although related to your method using more than 1 chip that there would be a new set of complexities involved in using 1 chip so i started a new thread. Again if this was not the correct thing to do i am sorry.

    i would now like to know where this question has been answered
    so that i can read this information and maybe get some use out of the replies

    quote:
    If i was sending data to a device (nmea) what would be the maximum interval between transmissions before the nmea device detects an error and displays the error or is this not defined in the standard?

    i do see similarities between the above question and the one below that has been posted, However it does not answer my question,

    quote:
    As there is no defined timing between the different talkers

    all that aside please forgive me if i have upset anyone.

    Now here is my code so far, and although not completed and there are no timeouts yet , being new to this i want to iron out mistakes before the code gets to complicated for me, running before i can walk as it were. I do not mind if i miss some sentances from a pin while i read another unless the recieving device minds the break in information for that particular device, im not sure how long a device can go without update from a particular talker before it objects, which i asked about it in the question above.

    If you see anything you dont think is right or you know of a more efficient way of achieving the same thing could you please let me know thanks.

    the code:-

    ' Routine to read imea sentance from a pin and send it
    ' then do the same from another pin and send it.

    testbyte VAR BYTE ' Define byte variable
    pinin1 VAR PORTC.1 ' Define serial pinin1 as PORTC.1
    pinin2 VAR PORTC.2 ' Define serial pinin2 as PORTC.2
    pinout VAR PORTC.7 ' Define serial pinout as PORTC.7

    ' For these examples, assume that the following string
    ' is being received continuously at 4800 baud on PORTC.7:

    start1:
    Serin2 pinin1,188,[testbyte] ' read portc.1
    if testbyte = "$" then begin1
    goto start1

    begin1:
    Serout2 pinout,188,[testbyte]
    goto loop1

    loop1:
    Serin2 pinin1,188,[testbyte]
    if testbyte = "$" then start2
    Serout2 pinout,188,[testbyte]
    goto loop1

    start2:
    Serin2 pinin2,188,[testbyte] ' read portc.2
    if testbyte = "$" then begin2 '
    goto start2

    begin2:
    Serout2 pinout,188,[testbyte]
    goto loop2

    loop2:
    Serin2 pinin2,188,[testbyte]
    if testbyte = "$"then start1
    Serout2 pinout,188,[testbyte]
    goto loop2
    Last edited by Richardco; - 25th November 2005 at 22:48.

Similar Threads

  1. Reading in Manchester code
    By brid0030 in forum Code Examples
    Replies: 0
    Last Post: - 10th March 2009, 21:55
  2. How much code space do PBP statements use.
    By Darrel Taylor in forum Code Examples
    Replies: 5
    Last Post: - 13th February 2009, 21:31
  3. Loop with two motor and 2 sensors
    By MrRoboto in forum mel PIC BASIC
    Replies: 4
    Last Post: - 8th December 2008, 23:40
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 08:26
  5. Re-Writing IF-THEN-AND-ENDIF code?
    By jessey in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 18th August 2006, 17:23

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