avr: tweaked timing for com2w transport layer.

This commit is contained in:
Martin Preuss
2025-08-19 23:03:15 +02:00
parent 102996f69f
commit fc073696f8
15 changed files with 311 additions and 189 deletions

View File

@@ -17,7 +17,7 @@
; PIR PB1 3 12 PA1 COM-DATA
; /RESET PB3 4 11 PA2 TCRT1000_Input
; PB2 5 10 PA3 LED
; COM_CLK PA7 6 9 PA4 TWI-SCL
; COM_CLK PA7 6 9 PA4 TWI-SCL
; TWI-SDA PA6 7 8 PA5
; --------
;

View File

@@ -59,7 +59,7 @@
#define MODULES_CLOCK
#define MODULES_LED_SIMPLE
#define MODULES_NETWORK
#define MODULES_UART_BITBANG
#define MODULES_COM2W
#define MODULES_TWI_MASTER
;#define MODULES_LCD
;#define LCD_MINIMAL_FONT
@@ -109,7 +109,7 @@
; rjmp main ; Reset vector
rjmp BOOTLOADER_ADDR ; Reset vector ; use this for flashed system
reti ; EXT_INT0
rjmp UART_BitBang_PcintIsr ; PCI0
rjmp com2wPcintIsr ; PCI0
reti ; PCI1
reti ; WATCHDOG
reti ; ICP1
@@ -204,7 +204,7 @@ onEveryLoop:
; ---------------------------------------------------------------------------
; defines for network interface
.equ netInterfaceData = uart_bitbang_iface
.equ netInterfaceData = com2w_iface

View File

@@ -17,7 +17,7 @@
; PIR PB1 3 12 PA1 COM-DATA
; /RESET PB3 4 11 PA2 TCRT1000_Input
; AUX-B2 PB2 5 10 PA3 LED
; COM_CLK PA7 6 9 PA4 TWI-SCL
; COM_CLK PA7 6 9 PA4 TWI-SCL
; TWI-SDA PA6 7 8 PA5
; --------
;

View File

@@ -17,7 +17,7 @@
; PIR PB1 3 12 PA1 COM-DATA
; /RESET PB3 4 11 PA2 AUX-PA2
; PB2 5 10 PA3 LED
; COM_CLK PA7 6 9 PA4 TWI-SCL
; COM_CLK PA7 6 9 PA4 TWI-SCL
; TWI-SDA PA6 7 8 PA5
; --------
;

View File

@@ -16,7 +16,7 @@
; PB1 3 12 PA1 COM-DATA
; PB3 4 11 PA2
; PB2 5 10 PA3 LED
; COM_CLK PA7 6 9 PA4 LED_CLK
; COM_CLK PA7 6 9 PA4 LED_CLK
; LED_DATA PA6 7 8 PA5 LED_Mode (0 for SPI)
; --------
;

View File

@@ -17,7 +17,7 @@
; PB1 3 12 PA1 COM-DATA
; /RESET PB3 4 11 PA2
; PB2 5 10 PA3 LED
; COM_CLK PA7 6 9 PA4 TWI-SCL
; COM_CLK PA7 6 9 PA4 TWI-SCL
; TWI-SDA PA6 7 8 PA5
; --------
;

View File

@@ -17,7 +17,7 @@
; PIR PB1 3 12 PA1 COM-DATA
; /RESET PB3 4 11 PA2 AUX-PA2
; PB2 5 10 PA3 LED
; COM_CLK PA7 6 9 PA4 TWI-SCL
; COM_CLK PA7 6 9 PA4 TWI-SCL
; TWI-SDA PA6 7 8 PA5
; --------
;

View File

@@ -13,9 +13,9 @@
; AtTiny 841
; -------
; VCC 1 14 GND
; PB0 2 13 PA0 ATTN0
; PB1 3 12 PA1 TXD0 (UART0)
; /RESET PB3 4 11 PA2 RXD0 (UART0)
; PB0 2 13 PA0 COM-CLK
; PB1 3 12 PA1
; /RESET PB3 4 11 PA2 COM-DATA
; LED PB2 5 10 PA3
; 1-wire PA7 6 9 PA4 RXD1 (UART1) [SCK, PRG]
; [MOSI,PRG] SDA (I2C) PA6 7 8 PA5 TXD1 (UART1) [MISO, PRG]

View File

@@ -83,9 +83,9 @@
.equ NET_BUFFERS_NUM = 10
.equ NET_MSGNUMINBUF_SIZE = 8 ; max buffer nums in ringbuffer (global incoming)
.equ NET_IFACE_OUTMSGBUF_SIZE = 8 ; max buffer nums in ringbuffer (per interface outbound)
.equ UART_HW_MSGNUMINBUF_SIZE = 8
.equ UART_HW_MSGNUMOUTBUF_SIZE = 8
@@ -110,7 +110,6 @@
rjmp BOOTLOADER_ADDR ; 1: RESET Reset vector use this for flashed system
reti ; 2: INT0 External Interrupt Request 0
; rjmp COM2W1_ClkChangeIsr ; 3: PCINT0 Pin Change Interrupt 0
rjmp com2wPcintIsr ; 3: PCINT0 Pin Change Interrupt 0
reti ; 4: PCINT1 Pin Change Interrupt 1
reti ; 5: WDT Watchdog Time-out
@@ -131,7 +130,6 @@
reti ; 20: TIM2_OVF (OVF2) Timer/Counter2 Overflow
reti ; 21: SPI SPI Serial Transfer Complete
reti ; 22: USART0_RXS USART0 Rx Start
; rjmp ComOnUart0_RxCharIsr ; 23: USART0_RXC USART0 Rx Complete
reti ; 23: USART0_RXC USART0 Rx Complete
reti ; 24: USART0_DRE USART0 Data Register Empty
reti ; 25: USART0_TXC USART0 Tx Complete
@@ -335,6 +333,5 @@ addMsgToInterface_toUart1:
; defines for network interface
.equ netInterfaceData = ttyOnUart1_iface
;.equ netInterfaceData2 = comOnUart0_iface
.equ netInterfaceData2 = com2w_iface

View File

@@ -75,7 +75,7 @@
;#define MODULES_DS18B20
;#define MODULES_MOTION
#define MODULES_NETWORK
#define MODULES_COM2W0
#define MODULES_COM2W
;#define MODULES_COMONUART0
#define MODULES_TTYONUART1
#define APPS_STATS
@@ -85,6 +85,8 @@
.equ NET_BUFFERS_NUM = 10
.equ NET_MSGNUMINBUF_SIZE = 8 ; max buffer nums in ringbuffer (global incoming)
.equ NET_IFACE_OUTMSGBUF_SIZE = 8 ; max buffer nums in ringbuffer (per interface outbound)
.equ UART_HW_MSGNUMINBUF_SIZE = 8
.equ UART_HW_MSGNUMOUTBUF_SIZE = 8
@@ -132,7 +134,7 @@
rjmp BOOTLOADER_ADDR ; 1: RESET Reset vector use this for flashed system
reti ; 2: INT0 External Interrupt Request 0
rjmp COM2W0_ClkChangeIsr ; 3: PCINT0 Pin Change Interrupt 0
rjmp com2wPcintIsr ; 3: PCINT0 Pin Change Interrupt 0
reti ; 4: PCINT1 Pin Change Interrupt 1
reti ; 5: WDT Watchdog Time-out
reti ; 6: TIM1_CAPT Timer/Counter1 Capture Event
@@ -244,8 +246,7 @@ onMessageReceived:
; defines for network interface
.equ netInterfaceData = ttyOnUart1_iface
;.equ netInterfaceData2 = comOnUart0_iface
.equ netInterfaceData2 = com2w0_iface
.equ netInterfaceData2 = com2w_iface
; debug