Menu

UBRR on 90 S8515

2019-06-02
2019-06-02
  • Bertrand BAROTH

    Bertrand BAROTH - 2019-06-02

    If I wanna use the hardware RS232 on 90S8515 (!), I have to add a line "UBRR = ... " (Thanks to William Roth and mmotte). What would be the "miracle" line to be added to the 90s8515.dat file, in order to automate this, including the calculation of correct value in conjunction with clock frquency ? And where should I add this, if possible ? I took a glance to the .dat file with the notepad ...

     
  • Anobium

    Anobium - 2019-06-02

    You may not have to.

    What is the value of UBRR ?

    If I assume UBRR = 127 (127 is the assummed value). Simply add to your source code.

    #define UBRR  127
    
     
  • Bertrand BAROTH

    Bertrand BAROTH - 2019-06-02

    And how to automate the calculation of the value ?

     
  • Anobium

    Anobium - 2019-06-02

    Post example code please. I would be guessing without the code.

     
  • Bertrand BAROTH

    Bertrand BAROTH - 2019-06-02

    Here it is (written for the Emic2 in conjunction with the STK200) : it is the test code for the speech on my railroad layout, it uses the pushbuttons to trigger the messages. And I wonder why, if I modify the code (headers for RS232 and the "Envoi" and "Attente" routines), the generated code is BIGGER with hardware RS232 than with software version ...

     
  • Anobium

    Anobium - 2019-06-02

    This is not as simple as adding UBRR to the .dat... as it is already defined in the .dat.

    Looking at the issue now.

     
    • Anobium

      Anobium - 2019-06-02

      Add the following to your code. Test please..

      This tells the compiler to use the register UBRR when assigning values to UBRRL

      #samevar UBRRL, UBRR
      
       
  • Bertrand BAROTH

    Bertrand BAROTH - 2019-06-02

    It doesn't work, if I don't assign a value to UBRR. All the way, I think that I will finally use the software version, since it is more efficient in terms of code size ... Thanks for Your efforts.

     
    • Anobium

      Anobium - 2019-06-02

      The root cause is the INITUART does not support your MCU. The library is assuming you have a mega328p from the characterics of the dat file.

      But, I would use the software... as this works for you.

       

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.