[<<][rtl][>>][..]
Tue Oct 23 16:57:23 CEST 2018

uart TX

Something is not right with tx_done.  Note: read has a wait state, but
tx_out should not be 0.


iw       ip tick_20khz tx_done tx_out
-------------------------------------
read:2    8          0       0      0 (4x)
read:2    8          0       0      1 (12x)
read:2    8          0       0      0 (96x)
read:2    8          0       1      0 (2x)
drop      9          0       1      0
push:150 10          0       1      0
loop:11  11          0       1      0 (32x)
loop:11  11          0       1      1 (119x)
push:17  12          0       1      1


Instead of trying to debug this, rewrite it.  Use a proper state
machine.  It's ok to use an external bit clock, but it is necessary to
wait.

Maybe it is the stop bit?  Because IF we wait for the next pulse to
send the start bit, it is ok to set done high once the stop bit is
sent out, giving some time during that bit to send a consecutive one.

EDIT: Test with /12 baud rate sending out 8 bit 0 bytes.
(+ 108 2 1 1 1 1) 114

(* 9 12) 108






uart_tx:
iw      ip tx_done tx_out
-------------------------
drop     0       1      1 (3x)
write:2  1       1      1
drop     2       0      1
read:2   3       0      1 (9x)
read:2   3       0      0 (108x)
read:2   3       1      0 (2x)
drop     4       1      0
drop     5       1      0
drop     0       1      0
write:2  1       1      0
drop     2       0      1
read:2   3       0      1 (5x)
read:2   3       0      0 (108x)
read:2   3       1      0 (2x)
drop     4       1      0
drop     5       1      0
drop     0       1      0
write:2  1       1      0
drop     2       0      1
read:2   3       0      1 (5x)
read:2   3       0      0 (108x)
read:2   3       1      0 (2x)
drop     4       1      0
drop     5       1      0
drop     0       1      0
write:2  1       1      0
drop     2       0      1
read:2   3       0      1 (5x)
read:2   3       0      0 (26x)



EDIT: I need a test for UART, so for the example soc in CPU.hs, add a baud clock.

Dammit, I can't figure it out.  Too complex.
EDIT: Bus size was 12 bit, which caused uart to be 8 bit as well.




[Reply][About]
[<<][rtl][>>][..]