Menu

Using RS-232

Help
MBB
2016-01-18
2016-01-20
  • MBB

    MBB - 2016-01-18

    I'm using version 0.95 with a 18F4550. I'm using the Terminal program included in the IDE and the HSERxxx commands.

    I'm able to send bytes and strings from the PIC to the GCB Terminal program.

    I would like to be able to send numbers and strings from the GCB terminal to the PIC. I've tried but have not been succesful. Is this even possible?

    If possible, does anyone have a sample program..

     
  • mmotte

    mmotte - 2016-01-18

    You are in luck! Just last month we added two new commands to the Hardware serial comport. You can check them out by going to the Help files on page http://gcbasic.sourceforge.net/help/
    and under Serial Communications> RS232 (Hardware) you will find : HSerGetNum
    and HSerGetString. Examples are inside.

    This month we are going to expand it to include multiple comports for both PIC and AVR.

    18F4550 has one USART on portC.6 and portC.7
    BR
    Mike

     
  • MBB

    MBB - 2016-01-19

    Thanks Mike.

    I tried it but I couldn't get it to work. The program freezes when it reaches the HSerGetNum or HSerGetString command.

    To send the HSerGetNum or HSerGetString command I go into the GCB Terminal program and in the block below the MACRO section, I enter 1 2, LED1 ON, or LED1 OFF followed by pressing the ENTER key or the SEND button. I've done it with and without the +CR button selected.

    Is this the correct way to do this?

     
  • mmotte

    mmotte - 2016-01-19

    Yes, the program should wait for your command so it is looping at the comport gathering your letters or numbers and then executing the command when the <cr> is hit.</cr>

    Backspacing don't do any good. just press <cr> to start over.</cr>

    I haven't had any luck using the macros in this terminal program.
    .
    The clear line below the macros i would enter LED1 OFF (, have the CR check box checked) and press send. It shuts off the led on mine.

    alternately

    The graybox scroll box below the clear line you can just enter text.
    put cursor in the graybox
    LED1 OFF (and press <enter>)
    It should shut off the led.</enter>

    I just took the GetString example off of the web and tried it and it works.

    Look at the receive window and see what was sent.

    There are a lot of terminal programs out there. I usually use Parallax serial Terminal just because It is simple and I am used to it. But this one works too.

    Let me know if you still have problems. We need to see you program.

    73
    Mike

     
  • mmotte

    mmotte - 2016-01-20

    Here is one of the test programs I am using. I just checked it.

    Did you notice the internal osc only goes to 8mhz?

     
  • MBB

    MBB - 2016-01-20

    I don't know why but the progarm I was using yesterday suddenly started working.

    Thanks for your help.

     

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.