Chapter 4 Parameters
|
Revision May 2008, ME14, SW V3.04
4-71
void main(){
int i;
outportb(PORT+MCR,0x08); /* interrupt enable */
outportb(PORT+IER,0x01); /* interrupt as data in */
outportb(PORT+LCR,(inportb(PORT+LCR) | 0x80));
/* the BRDL/BRDH can be access as LCR.b7==1 */
outportb(PORT+BRDL,12); /* set baudrate=9600, 12=115200/9600*/
outportb(PORT+BRDH,0x00);
outportb(PORT+LCR,0x06); /* set protocol, <7,N,2>=06H
<7,E,1>=1AH, <7,O,1>=0AH
<8,N,2>=07H, <8,E,1>=1BH
<8,O,1>=0BH */
for(i=0;i<=16;i++){
while(!(inportb(PORT+LSR) & 0x20)); /* wait until THR empty */
outportb(PORT+THR,tdat[i]); /* send data to THR */
}
i=0;
while(!kbhit()){
if(inportb(PORT+LSR) & 0x01){ /* b0==1, read data ready */
rdat[i++]=inportb(PORT+RDR); /* read data form RDR */
} } }
Summary of Contents for VFD-M Series
Page 1: ......
Page 2: ......
Page 3: ......
Page 12: ...Chapter 1 Introduction Revision May 2008 ME14 SW V3 04 1 3 1 1 4 External Parts and Labels ...
Page 17: ...Chapter 1 Introduction 1 8 Revision May 2008 ME14 SW V3 04 This page intentionally left blank ...
Page 21: ...Chapter 2 Installation and Wiring 2 4 Revision May 2008 ME14 SW V3 04 Good Not allowed ...
Page 121: ...Chapter 4 Parameters 4 86 Revision May 2008 ME14 SW V3 04 This page intentionally left blank ...
Page 149: ...Appendix B Accessories B 4 Revision May 2008 ME14 SW V3 04 ...