
Parallel Port C Reference Code
A-12
temp_lo = temp_lo | 0x10;
// Make DATA4 line high to signify speech data
}
//
Check for INRDY low or OUTRDY low –––– loop until one of them is low
do
{
stat = _inp(ParStatus) & 0x30;
}
while (stat == 0x30);
// If OUTRDY is low ––– then read the data (4 nibbles)
if(((stat & 0x10) == 0x10) || (stat == 0)) {
OUTRDY1 = recvbyte();
// 1st nibble
OUTRDY1 = OUTRDY1<<4;
// Wait for OUTRDY to go low again
do
{
stat = _inp(ParStatus) & 0x30;
}
while
(((stat & 0x20) != 0x0));
OUTRDY2 = recvbyte();
// read 2nd nibble
OUTRDY1 = OUTRDY2;
OUTRDY1 = OUTRDY1<<4;
// Wait for OUTRDY to go low again
do
{
stat = _inp(ParStatus) & 0x30;
}
while
(((stat & 0x20) != 0x0));
OUTRDY3 = recvbyte();
// read 3rd nibble
OUTRDY1 = OUTRDY3;
OUTRDY1 = OUTRDY1<<4;
// Wait for OUTRDY to go low again
do
{
stat = _inp(ParStatus) & 0x30;
}
while
(((stat & 0x20) != 0x0));
OUTRDY4 = recvbyte();
// read 4th nibble
OUTRDY1 = OUTRDY4;
printf(”status returned = %x\n”,OUTRDY1);
break;
}
// Check if INRDY is low
if ((stat & 0x10) != 0x10) {
if (hi == 1) { // decide if the high nibble to be sent
sendbyte(temp_hi);
// send the high nibble
hi = 0;
––i;
}
else
{
// else send low nibble
sendbyte(temp_lo);
// send low nibble
hi = 1;
}
}
}
// reconfigure the parallel port as it was before
_outp(0x402,0x00);
return(0);
}
void sendbyte(byte databyte)
{
Содержание MSP53C691
Страница 1: ...MSP53C691 Speech Synthesizer December 2000 MSDS Speech User s Guide SPSU020 ...
Страница 22: ...2 10 ...
Страница 96: ...C 6 ...