Hello everyone,
I have kind of a vague question that has been bothering me for a while and I can't seem to find a good answer.
Say I have a RS-232 receiver that collects data off the RX line and when it has a byte of data it puts it (parallel) on the output and then asserts a signal for one clock pulse to let the other part of the system know it has data. Now say I'm designing a module that will use that receiver and will give the data to another module in a more controlled way(IE buffer data if needed, doesn't require a single clock cycle pulse to be detected, ect).
So the main problem I have with this is managing the single clock cycle pulse. It seems to me that I must constantly be watching that signal to detect if it clocked or not. This causes my design to become very complicated(the way I handled it can be seen
here where the idle process is super complicated because I never let it leave that state but still try manage other things).
Is there a better/traditional way to do this?
My second question is related to giving data from one module to another. Say I want to confirm that the data was received, what is the traditional way to do this? Right now I use a super basic hand shaking kind of method. For example, if A wants to give a byte to B(assume A and B are independent and B may not always be available to read). A puts the data on the lines then asserts a 'data_ready' pin and waits for B. B sees 'data_ready' asserted and reads the data then asserts a 'data_read' pin and waits for A. A sees that 'data_read' is asserted and knows that the data has been read so it deserts(? terminology) 'data_ready' then waits for B. B then sees 'data_ready' go low, so it pulls 'data_read' low as an acknowledgement. Finally A sees 'data_read' go low and knows that the handshake is over and it can send more data if needed or just do something else.
This feels super cumbersome to me but I can't think of another(simpler) a way to guarantee that both sides know the data has been received. What is the convention usually?
Thanks for any input and tips on stuff like this I'm always happy to read.