installer: SERIAL: Use Timer1 instead of Timer2

Same as in the main code.

Use Timer1 as baudrate generator.
Timer1 can be programmed to have the same accuracy and deviation as
Timer2, up to 115200 at F_SYS = 125 Mhz. See comment
setup_serial_timer1() comment for valid baudrates and settings.
Timer1 is used in 8-bit auto-reload mode.

Only differance is that the serial is transmit only and poll-based so no
interrupts are used to transmit data.
This commit is contained in:
René van Dorst
2026-01-09 07:52:35 +01:00
parent 5b4b0efb16
commit c5c6b97ad1
2 changed files with 45 additions and 18 deletions
+3 -1
View File
@@ -121,7 +121,7 @@ __xdata char sfp_module_vendor[2][17];
__xdata char sfp_module_model[2][17];
__xdata char sfp_module_serial[2][17];
__xdata uint8_t sfp_options[2];
__sbit tx_buf_empty = 1;
__sbit tx_buf_empty;
#define ETHERTYPE_OFFSET (12 + VLAN_TAG_SIZE + RTL_TAG_SIZE)
@@ -1713,6 +1713,8 @@ void setup_serial_timer1(void)
TI = 0; // Clear TI-interrupt flag
RI = 0; // Clear RI-interrupt flag
tx_buf_empty = 1; // Set tx `serial buffer is empty`-software flag.
ES = 1; // Enable serial IRQ
}