|
How to send serial for once 2 bytes to CPU i8051?
#324794 - 04/16/14 07:39 PM
|
|
|
It would lost the first byte.
What shall I do?
m_maincpu->i8051_set_serial_rx_callback(read8_delegate(FUNC(bigmario_state::data_to_i8031),this));
READ8_MEMBER(bigmario_state::data_to_i8031) { return m_serial_data_in; }
THE OTHER PLACE: m_serial_data_in = 0x01; m_maincpu->set_input_line(MCS51_RX_LINE, ASSERT_LINE); //MCS51_RX_LINE P3.0: Serial Port Receive Line m_maincpu->set_input_line(MCS51_RX_LINE, CLEAR_LINE); m_serial_data_in = 0x02; m_maincpu->set_input_line(MCS51_RX_LINE, ASSERT_LINE); //MCS51_RX_LINE P3.0: Serial Port Receive Line m_maincpu->set_input_line(MCS51_RX_LINE, CLEAR_LINE);
|
|
|
|
Re: How to send serial for once 2 bytes to CPU i8051?
[Re: lxd]
#324851 - 04/17/14 05:45 PM
|
|
|
I have done it. Sorry for my English level. It's complex, so I have to use Chinese.
依据8031的CPU手册,发送串口数据给CPU的时候,CPU需要一位一位的收取,如果上一位还没收取完成,就送下一位,肯定会覆盖掉前一位的数据。另外,如果CPU处于中断状态,串口中断优先级最低,也会造成数据丢失。
解决办法是: 1,在8031的ROM里将串口中断优先级提高,不要轻易 CLR EA 2,在游戏驱动里,将连续发送的的字符先存入队列,例如 #include <queue> std::queue<int> m_fifo; //串口缓冲 然后等上一个数据发送完成,并且CPU回调的时候,再发送下一个数据。
|
|
|
|
Re: How to send serial for once 2 bytes to CPU i8051?
[Re: lxd]
#324934 - 04/19/14 03:45 AM
|
|
|
Please... Write plain english. Doesn't matter how bad could be. Always will be better than chinese for us.
And BTW.... Why are you not sending us all these fixes you're claiming to made, among your 'bigmario' driver?
|
-- Risen from my grave --
|
|
Stiletto |
They're always after me Lucky ROMS!
|
|
|
Reged: 03/07/04
|
Posts: 6472
|
|
|
Send PM
|
|
|
Re: How to send serial for once 2 bytes to CPU i8051?
[Re: Roberto Fresca]
#324936 - 04/19/14 04:59 AM
|
|
|
|
|
|
Sorry for I have not finished it.
It's the picture of the game.
[ATTACHED IMAGE]
|
|
|
|
Re: How to send serial for once 2 bytes to CPU i8051?
[Re: lxd]
#324985 - 04/20/14 06:58 AM Attachment: icb.jpg 39 KB (0 downloads)
|
|
|
The IC board
[ATTACHED IMAGE]
|
|
|