I have a Xilinx Spartan-3E and what i want to do is this:
Press a button ex. East Button on the board and send a signal eg. "00101100" to a device on the other end of Spartans RS232 port.
Like when i press the button and the leds are on i want to send this signal over the serial port lets say to a PC on the other end.
The only thing i have done is to send a character via hyperterminal to the board and return me another character. but when i try to use the board as the master i get stuck.
Here is one possible approach to the project. Each time the button is pressed, you can load a shift register with the desired serial bit pattern, including the start and stop bits. The clock shifts the register out to the serial port. Of course you also need a baud rate counter that controls the shift rate. You may also need to debounce the pushbutton. That's just one general approach.
I was thinking of writing a Wishbone Master interface so that it is triggered every time i press a button on the board and will send the data associated to that button. Just by sending the data as you proposed it is not always sure if the data will be sent if the channel is busy.
The thing is that i am trying to write the VHDL code without having much experience on that field.
--- Update begins ---
I finally did it! I used the Wishbone interface to send and receive data from the FPGA to the PC and tomorrow i will try to drive a robotic arm using the signals i send via the serial port from the FPGA to the robotic arm. Hope it works.
--- Update ends ---