From 4e4e25d005863461a1c09d435ed849c945cee541 Mon Sep 17 00:00:00 2001 From: Gustavo Henrique Santos Souza de Miranda Date: Thu, 4 Jun 2026 21:06:50 -0300 Subject: [PATCH] Refine write_bus timing: position data within the CS / WR window using datasheet intervals --- Lib/YMF262-HAL/Inc/YMF262-HAL.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Lib/YMF262-HAL/Inc/YMF262-HAL.hpp b/Lib/YMF262-HAL/Inc/YMF262-HAL.hpp index 2fad9f7..6fad4ff 100644 --- a/Lib/YMF262-HAL/Inc/YMF262-HAL.hpp +++ b/Lib/YMF262-HAL/Inc/YMF262-HAL.hpp @@ -52,11 +52,13 @@ class YMF262_HAL{ _gpio.delay_ticks(_t_as_ticks); _gpio.set_cs(State::ACTIVE); _gpio.set_wr(State::ACTIVE); + _gpio.delay_ticks(_t_ww_ticks-_t_wds_ticks); _gpio.set_data_bus(data); _gpio.delay_ticks(_t_wds_ticks); _gpio.set_wr(State::INACTIVE); _gpio.set_cs(State::INACTIVE); - _gpio.delay_ticks(_t_wdh_ticks); + _gpio.delay_ticks(_t_ah_ticks); + _gpio.delay_ticks(_t_wdh_ticks-_t_ah_ticks); _gpio.delay_ticks(_t_recovery_ticks); };