Shop OBEX P1 Docs P2 Docs Learn Events
Help with some final details on dual UART — Parallax Forums

Help with some final details on dual UART

John WhitfieldJohn Whitfield Posts: 42
edited 2005-06-13 10:21 in General Discussion
I am still having some minor problems with the program.

I added at routine SendCodes to send the stabilizing set of codes to the speakjet without taking up that much more room on the chip. But, even before that, sometimes the chip wasn't sending the science and unit codes.

Also, the delay I added is supposed to be 5.5 seconds, but it doesn't sound that way.

Finally, if anyone knows of a good free schematic program for laying out circuits that will print out in a way that will be useful in using a radioshack board making kit and export in a way that is good for posting on the web, please let me know.

Once I solve these minor problems I will post the final code and schematics on the forum. Not to mention turn in the product to the sponsors and the school. I really want to thank everybody for helping me, since I don't think I could have·done it otherwise.

Thanks,
-John Whitfield

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-06-13 05:16
    John,

    Due to the added delay variables d4 to d7, the variables d7 and temp2 now overlap with

    Prescaler1 and Txhigh1.

    You should make delay_5s5 a routine that calls delay_0s5 eleven times.

    _delay_5s5

    mov d4,#11

    :delay

    call @delay_0s5

    djnz d4,:delay

    retp

    Then you don't need d5 to d7 anymore.

    regards peter
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-06-13 05:45
    John,

    At the end of _GetString1 you placed

    ··· call··· @GetByte1
    ··· bank··· DMM
    ··· mov···· cr, w··;carriage return
    ··· cjne··· cr,#$0D,MainLoop··· ;check to make sure carriage return was recieved
    ··· retp

    Now, if due to transmission error you don't receive $0D, you jump back to Mainloop.

    That won't do. Not only is Mainloop·in another page but worse: this corrupts your call stack.

    Just assume the $0D is correctly received by loading cr with $0D.

    ··· call··· @GetByte1
    ··· bank··· DMM
    ··· mov···· cr, #$0D··;carriage return
    ··· retp


    regards peter
  • John WhitfieldJohn Whitfield Posts: 42
    edited 2005-06-13 07:04
    Peter,
    The cr variable is the last code sent out by the multimeter each time and I don't know if it necessary to take in or not since it is not used in the comparion code, but I thought it might be important for the timing and as an error check. As far as the jmp to MainLoop, that's what you get learning assembly language on your own... stupid mistakes.

    Thanks,
    -John Whitfield
  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2005-06-13 10:21
    John,

    That last byte is important regarding the timing, you need to read 14 bytes,

    but as it is not used in the comparison, just set cr to the correct value.

    regards peter
    ·
Sign In or Register to comment.