November 9, 2023

Let's learn USB! -- Papoon -- a bug!

I am right in the middle of this, so you could get busy, download my code, and solve this for me.

I added a function usb_putc ( '5' ) to send single characters over USB. I tested it by putting it in a loop with some delay and indeed it works and pumps out the character '5' endlessly.

I was doing some more testing and getting odd results, so I dropped back and tried something simple. I put two calls back to back like this:

	for ( ;; ) {
	    papoon_putc ( '5' );
	    papoon_putc ( '6' );
            delay_ms ( 100 );
        }

This fails. I get endless '5' characters and the '6' written immediately after vanishes. If I put delay_ms (1) between the two putc calls, it works just fine.

This is interesting, but not good.


Feedback? Questions? Drop me a line!

Tom's Computer Info / tom@mmto.org