Menu

HARDWARE problem with UART

Help
2014-02-17
2014-02-20
  • alejandro1957

    alejandro1957 - 2014-02-17

    as the title, if I use the libraries HW for the 16F877A transmizione does not work (via RF).
    Instead if I use the SW library works fine.

    Solved, see https://sourceforge.net/p/gcbasic/discussion/579126/thread/19179e44/#5482 edited Anobium to link to closure posting.

     

    Last edit: Anobium 2014-02-20
  • Anobium

    Anobium - 2014-02-17

    Please post your code, your pinout and any relevant information.

     
  • Anobium

    Anobium - 2014-02-18

    I do not have your chip type. So, I cannot test.

    Try the following code. I am not sure why you are calling InitUSART.

    What is your version of the compiler? How are you testing? How do you know it is 'dirty'? And, what is your oscillator config?

    ~~~~~
    #CHIP 16F877A,4
    #CONFIG OSC=XT,WDT_OFF,PWRTE_ON,CP_OFF,DEBUG_OFF,WRT_OFF,CPD_OFF,LVP_OFF,BODEN_ON

    ' Define the USART port

    #DEFINE USART_BLOCKING TRUE
    #DEFINE USART_BAUD_RATE 1200

    ' Ensure these port addresses are correct
    #define SerInPort PORTc.7
    #define SerOutPort PORTc.6
    'Set pin directions
    Dir SerOutPort Out
    Dir SerInPort In
    WAIT 1 s
    DO
    HSerPrint "HOLA"
    HSerSend 13
    WAIT 50 ms
    LOOP

     

    Last edit: Anobium 2014-02-18
    • alejandro1957

      alejandro1957 - 2014-02-18

      always like to initialize the library usart.c

      Great Cow BASIC (0.9 17/7/2011)

      with a serial terminal in Gambas3 (works fine).
      all in RF 433mhz.

      OSC 4mhz

      to be noted that even with a 16F628A there is this discrepancy (SW works, HW does not work)

      SW
      alternate text

      HW
      alternate text

       
      • alejandro1957

        alejandro1957 - 2014-02-18

        I forgot that I have always used this code and it always worked.
        as well as the HW

         
  • Anobium

    Anobium - 2014-02-18

    Did you test the code I provided? What were the results?
    Please test by changing you PC software to PUTTY.EXE. You can download this. What is the result using putty.exe?

    Thank you.

     
  • alejandro1957

    alejandro1957 - 2014-02-18

    Gambas3 is a programming environment for basic linux (I use the distro LinuxMint Nadia Cinnamon).

    same problem

    I'll try on my son's PC with Hyperterminal.

     
  • Anobium

    Anobium - 2014-02-19

    See below for Google Translate of this message. :-)

    So, you get the same problem using the code I provided? If, yes. Then, please test on your son's PC.

    However, how are you connecting between the pic and your PC? Are you using a MAX232 or similar device?

    And, I am getting the same chips as you from Microchip - they may take a day or two to get here.

    :-)

    Così, si ottiene lo stesso problema utilizzando il codice che ho fornito? Se, sì. Poi, si prega di verificare sul PC di tuo figlio.

    Tuttavia, come vi state collegando tra la microchip e il vostro PC? Stai usando un MAX232 o un dispositivo simile?

    E, io sono sempre gli stessi chip come lei da Microchip - possono prendere un giorno o due per arrivare qui.

    :-)

     
    • alejandro1957

      alejandro1957 - 2014-02-19

      yes, from the same mistake.
      yes, use a max232
      hw works with the same software library.

      yes, the translator of google is my friend :P

       
  • Anobium

    Anobium - 2014-02-19

    Thank you. So, your son's computer connected to your Microchip has the same issue. 😞

    It's time to get you the latest GCB code. Send me a personal email and I will send you a download link.

     
    • alejandro1957

      alejandro1957 - 2014-02-19

      I sent my e-mail

       
  • Anobium

    Anobium - 2014-02-19

    I have sent you the Sept 2013 code for GCB.

    Please try first and let us know the results. Please backup your folders and config before updating.

    If the update fails then try your new method.

    Anobium

     
  • Anobium

    Anobium - 2014-02-19

    What fixed it? New code or your function?

    :-)

     
  • alejandro1957

    alejandro1957 - 2014-02-19

    now also works HW library.
    but the code posted by me is less "heavy" and it serves my purpose.
    GCBasic is always the best.
    As you put SOLVED?

     
  • Anobium

    Anobium - 2014-02-20

    Case solved. Update the code. You have more functionality also - see the new helpfile.

    :-)

     
  • alejandro1957

    alejandro1957 - 2014-02-20

    how do I write as solved??

     
  • Anobium

    Anobium - 2014-02-20

    Se fossi Sherlock Holmes, il famoso detective inglese, direi 'caso chiuso'. Ma, io non sono. :-)

    Raccomando il termine 'risolto'.

    'Risolto. Aggiornamento per ultimo codice GCB ha risolto il problema '

     

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.