Menu

Hardware RS-232

Help
2009-12-10
2013-05-30
  • Edward LaBudde

    Edward LaBudde - 2009-12-10

    Hi all, I started working with the new hardware serial commands in version
    (0.9 15/11/2009)

    Have been using the software RS-232 with great success.  I have a very simple program to drive a serial LCD:#chip 16F88, 20

    #define USART_BAUD_RATE 2400

    Dir PORTB.5 Out ‘pin 11
    'Main loop:
    Main:
    HserPrint "123456789"
    wait 1 s
    goto Main

    Here is what the display print looks like:
    19191919191919

    It only prints the first and last characters, no matter what I try to print.

    Any Ideas?  Thanks, Ed.

    BTW I finally got around to testing the new delay times.

    Here are the results:
    1 ms = 5007, 1000 us = 5000, 100 10us = 5005
    2 ms = 10005, 2000 us =10001
    3 ms = 15003, 3000 us = 15000
    4 ms = 20001, 4000 us = 20000
    5 ms = 24999, 5000 us = 25001
    6 ms = 29997, 6000 us = 30000
    7 ms = 34995, 7000 us = 35000
    8 ms = 39993, 8000 us = 40001
    9 ms = 44991, 9000 us = 45000
    10 ms = 49989, 10000 us = 50000, 1 10ms = 49997

    Looks like the “us” commands are real good!  Thanks Hugh.

     
  • Frank

    Frank - 2009-12-11

    Hi,

    Have you tried using the define for USART_BLOCKING?

    You may need to edit you're usart.h file to get it to work as there is or was a bug in the usart blocking for transmit. See the following post by arcachofo for the details.

      : http://sourceforge.net/projects/gcbasic/forums/forum/596084/topic/3440387

    Frank

     
  • Edward LaBudde

    Edward LaBudde - 2009-12-11

    Federon, Thanks.  You are correct.  One must use the #define USART_BLOCKING command and correct the error in Usart.h to enable all characters to come across

    I was following the example in the help file.  I also found other errors.  The example is missing the flowing lines:
    #define USART_BLOCKING
    #define SerInPort PORTB.6 
    #define SerOutPort PORTB.7

    Thanks again.  Ed.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.