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 ...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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 ...
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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 ...
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.
And how to automate the calculation of the value ?
Post example code please. I would be guessing without the code.
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 ...
This is not as simple as adding UBRR to the .dat... as it is already defined in the .dat.
Looking at the issue now.
Add the following to your code. Test please..
This tells the compiler to use the register UBRR when assigning values to UBRRL
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.
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.