Forum Discussion
Altera_Forum
Honored Contributor
9 years agoUART VDHL code not working getting only garbage values
0down votefavorite (http://stackoverflow.com/questions/42851856/uart-vdhl-code-not-working-getting-only-garbage-values#) I am trying to do the code in this link https://www.youtube.com/wa...
Altera_Forum
Honored Contributor
9 years agoJust took a cursory look, but there are many problems with the code. What is TX_LINE before the start bit? It should be '1' or the receiver won't see the start bit and it should be back at 1 at the end. And why is it changing the bit value in the middle of the bit period? The value of TX_LINE is undefined for the first half of the first bit and you don't get the last half of the stop bit.
The TX part of a UART is pretty simple. You would be better off throwing out this code and thinking it through for yourself. Normally, things like counters would be in a separate process and also people would use a FSM and drive outputs based on a current state. For example, TX_FLG is useless.