MAMEWorld >> Programming
Previous thread Previous  View all threads Index   Next thread Next   Flat Mode Flat  

lxd
MAME Fan
Reged: 02/27/14
Posts: 25
Send PM
Re: How to send serial for once 2 bytes to CPU i8051?
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回调的时候,再发送下一个数据。







Entire thread
Subject Posted by Posted on
* How to send serial for once 2 bytes to CPU i8051? lxd 04/16/14 07:39 PM
. * Re: How to send serial for once 2 bytes to CPU i8051? lxd  04/17/14 05:45 PM
. * Re: How to send serial for once 2 bytes to CPU i8051? Roberto Fresca  04/19/14 03:45 AM
. * Re: How to send serial for once 2 bytes to CPU i8051? lxd  04/20/14 06:57 AM
. * Re: How to send serial for once 2 bytes to CPU i8051? lxd  04/20/14 06:58 AM
. * Re: How to send serial for once 2 bytes to CPU i8051? StilettoAdministrator  04/19/14 04:59 AM

Extra information Permissions
Moderator:  Pi 
0 registered and 23 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 4299