FPGARelated.com
Forums

sending multiple char on RS232

Started by YiQi May 16, 2006
>1) If the UART received a char (RDA = '1') then goto 2, else goto 1 >2) Read the char from the UART. If the char is ASCII '1' (31h) then >goto 3 else goto 1 >( rdSig <= '1'; if dbOutSig = x"31" then goto 3 ) >3) if the UART's Transmit Buffer is Empty (TBE = '1') then goto 4, else >back to 3 >4) write the 1st char into the UART (wrSig <= '1', dbInSig <= char in >signal X) >5) if the UART's Transmit Buffer is Empty (TBE = '1') then goto 6, else >back to 5 >6) write the 2nd char into the UART >( wrSig <= '1', dbInSig <= char in signal Y ) >DONE
Dave, I could sorry to say your steps won work, It the 1st char won able to send. Because the speed of the FPGA clock is 50MHz and the UART is lot more slow. For this FSM, it is operating in the FPGA clock in 50MHz, while the first char is place into the data bus, and the FSM just into step 5, the UART component still hasn't been update(slow clocking at 9600). The TBE will still in '1', so it will overwrite the 1st char and send the 2nd one. That's why i will need to wait until TBE to '0'. This could be fix by simply adding a condition that until the TBE = '0' then go to step 5, otherwise stay at step 4. What I don't understand is in my code, why I need to have a waitSend state before the initial state of the next char? Sorry... I think I am a "problem kid", questions keep coming up, and I couldn't solve it. Please do help me. ... Thanks YiQi