00001 #include "rtl8019.h"
00002 #include "delay.h"
00003 #include "debug.h"
00004 #include "avr/pgmspace.h"
00005 #include "rtlregs.h"
00006
00007 #ifndef cbi
00008 #define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
00009 #endif
00010 #ifndef sbi
00011 #define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
00012 #endif
00013
00014 #define outp(val, port) do { (port) = (val); } while(0)
00015 #define inp(port) (port)
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060 #if MEMORY_MAPPED_NIC == 1
00061
00062
00063
00064
00065 #define writeRTL nic_write
00066 #else
00067
00068
00069 void writeRTL(unsigned char address, unsigned char data)
00070 {
00071
00072 outp( address, RTL8019_ADDRESS_PORT );
00073 outp( 0xFF, RTL8019_DATA_DDR );
00074 outp( data, RTL8019_DATA_PORT );
00075
00076
00077 RTL8019_CLEAR_WRITE;
00078 RTL8019_SET_WRITE;
00079
00080
00081 outp( 0x00, RTL8019_DATA_DDR );
00082 outp( 0xFF, RTL8019_DATA_PORT );
00083 }
00084
00085
00086
00087 #endif
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105 #if MEMORY_MAPPED_NIC == 1
00106
00107
00108
00109 #define readRTL nic_read
00110 #else
00111
00112 unsigned char readRTL(unsigned char address)
00113 {
00114 unsigned char byte;
00115
00116
00117 outp( address, RTL8019_ADDRESS_PORT );
00118
00119
00120
00121
00122 RTL8019_CLEAR_READ;
00123 nop();
00124
00125
00126 byte = inp( RTL8019_DATA_PIN );
00127
00128
00129 RTL8019_SET_READ;
00130
00131 return byte;
00132 }
00133
00134 #endif
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146 void RTL8019setupPorts(void)
00147 {
00148 volatile unsigned char *base = (unsigned char *)0x8300;
00149
00150 #if MEMORY_MAPPED_NIC == 1
00151
00152 outp(inp(MCUCR) | (1<<SRE), MCUCR);
00153
00154 #else
00155
00156
00157 outp( 0xFF, RTL8019_ADDRESS_DDR );
00158
00159
00160 outp( 0xFF, RTL8019_DATA_PORT );
00161
00162
00163
00164
00165 sbi( RTL8019_CONTROL_DDR, RTL8019_CONTROL_READPIN );
00166 sbi( RTL8019_CONTROL_DDR, RTL8019_CONTROL_WRITEPIN );
00167
00168
00169
00170 sbi( RTL8019_CONTROL_PORT, RTL8019_CONTROL_READPIN );
00171 sbi( RTL8019_CONTROL_PORT, RTL8019_CONTROL_WRITEPIN );
00172
00173 #endif
00174
00175
00176 sbi( RTL8019_RESET_DDR, RTL8019_RESET_PIN );
00177
00178
00179
00180
00181
00182 }
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210 void overrun(void);
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220 #define CR 0x00
00221 #define PSTART 0x01
00222 #define PAR0 0x01 // Page 1
00223 #define CR9346 0x01 // Page 3
00224 #define PSTOP 0x02
00225 #define BNRY 0x03
00226 #define TSR 0x04
00227 #define TPSR 0x04
00228 #define TBCR0 0x05
00229 #define NCR 0x05
00230 #define TBCR1 0x06
00231 #define ISR 0x07
00232 #define CURR 0x07 // Page 1
00233 #define RSAR0 0x08
00234 #define CRDA0 0x08
00235 #define RSAR1 0x09
00236 #define CRDA1 0x09
00237 #define RBCR0 0x0A
00238 #define RBCR1 0x0B
00239 #define RSR 0x0C
00240 #define RCR 0x0C
00241 #define TCR 0x0D
00242 #define CNTR0 0x0D
00243 #define DCR 0x0E
00244 #define CNTR1 0x0E
00245 #define IMR 0x0F
00246 #define CNTR2 0x0F
00247 #define RDMAPORT 0x10
00248 #define RSTPORT 0x18
00249
00250
00251
00252
00253
00254
00255
00256 #define ISR_RST 7
00257 #define ISR_OVW 4
00258 #define ISR_PRX 0
00259 #define ISR_RDC 6
00260 #define ISR_PTX 1
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270 #define RCR_INIT 0x04
00271
00272
00273 #define TCR_INIT 0x00
00274
00275
00276
00277
00278 #define DCR_INIT 0x58
00279
00280
00281 #define IMR_INIT 0x11
00282
00283
00284
00285
00286 #define TXSTART_INIT 0x40
00287 #define RXSTART_INIT 0x46
00288 #define RXSTOP_INIT 0x60
00289
00290
00291
00292 void RTL8019beginPacketSend(unsigned int packetLength)
00293 {
00294
00295 volatile unsigned char *base = (unsigned char *)0x8300;
00296 unsigned int sendPacketLength;
00297 sendPacketLength = (packetLength>=ETHERNET_MIN_PACKET_LENGTH) ?
00298 packetLength : ETHERNET_MIN_PACKET_LENGTH ;
00299
00300
00301 writeRTL(CR,0x22);
00302
00303
00304 while( readRTL(CR) & 0x04 );
00305
00306
00307 writeRTL(TPSR,TXSTART_INIT);
00308
00309
00310 writeRTL(RSAR0,0x00);
00311 writeRTL(RSAR1,0x40);
00312
00313
00314 writeRTL(ISR,(1<<ISR_PTX));
00315
00316
00317 writeRTL(RBCR0, (unsigned char)(packetLength));
00318 writeRTL(RBCR1, (unsigned char)(packetLength>>8));
00319
00320 writeRTL(TBCR0, (unsigned char)(sendPacketLength));
00321 writeRTL(TBCR1, (unsigned char)((sendPacketLength)>>8));
00322
00323
00324 writeRTL(CR,0x12);
00325 }
00326
00327
00328
00329 void RTL8019sendPacketData(unsigned char * localBuffer, unsigned int length)
00330 {
00331 unsigned int i;
00332 volatile unsigned char *base = (unsigned char *)0x8300;
00333 for(i=0;i<length;i++)
00334 writeRTL(RDMAPORT, localBuffer[i]);
00335 }
00336
00337
00338
00339 void RTL8019endPacketSend(void)
00340 {
00341 volatile unsigned char *base = (unsigned char *)0x8300;
00342
00343 writeRTL(CR,0x24);
00344
00345
00346 writeRTL(ISR, (1<<ISR_RDC));
00347 }
00348
00349
00350
00351
00352
00353 static unsigned char nextPage;
00354 static unsigned int currentRetreiveAddress;
00355
00356
00357 #define enetpacketstatus 0x00
00358 #define nextblock_ptr 0x01
00359 #define enetpacketLenL 0x02
00360 #define enetpacketLenH 0x03
00361
00362
00363
00364 unsigned int RTL8019beginPacketRetreive(void)
00365 {
00366 volatile unsigned char *base = (unsigned char *)0x8300;
00367 unsigned char i;
00368 unsigned char bnry;
00369
00370 unsigned char pageheader[4];
00371 unsigned int rxlen;
00372
00373
00374 processRTL8019Interrupt();
00375
00376
00377 writeRTL(CR,0x62);
00378 i = readRTL(CURR);
00379
00380
00381 writeRTL(CR,0x22);
00382
00383
00384 bnry = readRTL(BNRY) ;
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394 if( bnry == i ) {
00395 return 0;
00396 }
00397
00398
00399
00400 writeRTL(ISR, (1<<ISR_PRX));
00401
00402
00403
00404 if( (bnry >= RXSTOP_INIT) || (bnry < RXSTART_INIT) )
00405 {
00406 writeRTL(BNRY, RXSTART_INIT);
00407 writeRTL(CR, 0x62);
00408 writeRTL(CURR, RXSTART_INIT);
00409 writeRTL(CR, 0x22);
00410 return 0;
00411 }
00412
00413
00414 writeRTL(RBCR0, 4);
00415 writeRTL(RBCR1, 0);
00416 writeRTL(RSAR0, 0);
00417 writeRTL(RSAR1, bnry);
00418 writeRTL(CR, 0x0A);
00419
00420
00421 for(i=0;i<4;i++) {
00422 pageheader[i] = readRTL(RDMAPORT);
00423
00424 }
00425
00426
00427 writeRTL(CR, 0x22);
00428 for(i = 0; i <= 20; i++) {
00429 if(readRTL(ISR) & 1<<6) {
00430 break;
00431 }
00432 }
00433 writeRTL(ISR, 1<<6);
00434
00435
00436
00437 rxlen = (pageheader[enetpacketLenH]<<8) + pageheader[enetpacketLenL];
00438 nextPage = pageheader[nextblock_ptr] ;
00439
00440 currentRetreiveAddress = (bnry<<8) + 4;
00441
00442
00443
00444
00445
00446 if( (nextPage >= RXSTOP_INIT) || (nextPage < RXSTART_INIT) ) {
00447
00448 return 0;
00449 }
00450
00451 return rxlen-4;
00452 }
00453
00454
00455 void RTL8019retreivePacketData(unsigned char * localBuffer, unsigned int length)
00456 {
00457 unsigned int i;
00458 volatile unsigned char *base = (unsigned char *)0x8300;
00459
00460 writeRTL(RBCR0, (unsigned char)length);
00461 writeRTL(RBCR1, (unsigned char)(length>>8));
00462 writeRTL(RSAR0, (unsigned char)currentRetreiveAddress);
00463 writeRTL(RSAR1, (unsigned char)(currentRetreiveAddress>>8));
00464 writeRTL(CR, 0x0A);
00465 for(i=0;i<length;i++)
00466 localBuffer[i] = readRTL(RDMAPORT);
00467
00468
00469 writeRTL(CR, 0x22);
00470 for(i = 0; i <= 20; i++)
00471 if(readRTL(ISR) & 1<<6)
00472 break;
00473 writeRTL(ISR, 1<<6);
00474
00475 currentRetreiveAddress += length;
00476 if( currentRetreiveAddress >= 0x6000 )
00477 currentRetreiveAddress = currentRetreiveAddress - (0x6000-0x4600) ;
00478 }
00479
00480
00481
00482 void RTL8019endPacketRetreive(void)
00483 {
00484 volatile unsigned char *base = (unsigned char *)0x8300;
00485 unsigned char i;
00486
00487
00488 writeRTL(CR, 0x22);
00489 for(i = 0; i <= 20; i++)
00490 if(readRTL(ISR) & 1<<6)
00491 break;
00492 writeRTL(ISR, 1<<6);
00493
00494
00495 writeRTL(BNRY, nextPage);
00496 }
00497
00498
00499 void overrun(void)
00500 {
00501 volatile unsigned char *base = (unsigned char *)0x8300;
00502 unsigned char data_L, resend;
00503
00504 data_L = readRTL(CR);
00505 writeRTL(CR, 0x21);
00506 Delay_1ms(2);
00507 writeRTL(RBCR0, 0x00);
00508 writeRTL(RBCR1, 0x00);
00509 if(!(data_L & 0x04))
00510 resend = 0;
00511 else if(data_L & 0x04)
00512 {
00513 data_L = readRTL(ISR);
00514 if((data_L & 0x02) || (data_L & 0x08))
00515 resend = 0;
00516 else
00517 resend = 1;
00518 }
00519
00520 writeRTL(TCR, 0x02);
00521 writeRTL(CR, 0x22);
00522 writeRTL(BNRY, RXSTART_INIT);
00523 writeRTL(CR, 0x62);
00524 writeRTL(CURR, RXSTART_INIT);
00525 writeRTL(CR, 0x22);
00526 writeRTL(ISR, 0x10);
00527 writeRTL(TCR, TCR_INIT);
00528
00529 writeRTL(ISR, 0xFF);
00530 }
00531
00532
00533
00534
00535
00536
00537
00538 #define NIC_PAGE_SIZE 0x100
00539
00540
00541
00542
00543 #define NIC_START_PAGE 0x40
00544
00545
00546
00547
00548 #define NIC_STOP_PAGE 0x60
00549
00550
00551
00552
00553
00554
00555 #define NIC_TX_PAGES 6
00556
00557
00558
00559
00560 #define NIC_TX_BUFFERS 2
00561
00562
00563
00564
00565
00566
00567
00568 #define NIC_FIRST_TX_PAGE NIC_START_PAGE
00569 #define NIC_FIRST_RX_PAGE (NIC_FIRST_TX_PAGE + NIC_TX_PAGES * NIC_TX_BUFFERS)
00570
00571
00572
00573
00574 #define TX_PAGES 12
00575
00576 static unsigned char mac[6] = {0x00,0x06,0x98,0x01,0x02,0x29};
00577 void Delay(long nops)
00578 {
00579 volatile long i;
00580
00581 for(i = 0; i < nops; i++)
00582 #ifdef __IMAGECRAFT__
00583 asm("nop\n");
00584 #else
00585 asm volatile("nop\n\t"::);
00586 #endif
00587 }
00588
00589 static int NicReset(void)
00590 {
00591 volatile unsigned char *base = (unsigned char *)0x8300;
00592 unsigned char i;
00593 unsigned char j;
00594
00595 for(j = 0; j < 20; j++) {
00596 debug_print(PSTR("SW-Reset..."));
00597 i = nic_read(NIC_RESET);
00598 Delay(500);
00599 nic_write(NIC_RESET, i);
00600 for(i = 0; i < 20; i++) {
00601 Delay(5000);
00602
00603
00604
00605
00606 if((nic_read(NIC_PG0_ISR) & NIC_ISR_RST) != 0 &&
00607 nic_read(NIC_PG0_RBCR0) == 0x50 &&
00608 nic_read(NIC_PG0_RBCR1) == 0x70) {
00609 debug_print(PSTR("OK\r\n"));
00610 return 0;
00611 }
00612 }
00613 debug_print(PSTR("failed\r\n\x07"));
00614
00615
00616
00617
00618
00619
00620 if(j == 10) {
00621 debug_print(PSTR("Ethernut 1.1 HW-Reset\r\n"));
00622 sbi(DDRE, 4);
00623 sbi(PORTE, 4);
00624 Delay(100000);
00625 cbi(PORTE, 4);
00626 Delay(250000);
00627 }
00628 }
00629 return -1;
00630 }
00631
00632 void initRTL8019(void)
00633 {
00634 unsigned char i, rb;
00635 volatile unsigned char *base = (unsigned char *)0x8300;
00636
00637 RTL8019setupPorts();
00638
00639
00640
00641
00642
00643
00644 cbi(EIMSK, INT5);
00645
00646
00647
00648 #if 0
00649
00650
00651
00652
00653 nic_write(NIC_PG0_IMR, 0);
00654 nic_write(NIC_PG0_ISR, 0xff);
00655
00656
00657
00658
00659
00660
00661
00662
00663 nic_write(NIC_CR, NIC_CR_STP | NIC_CR_RD2 | NIC_CR_PS0 | NIC_CR_PS1);
00664
00665
00666
00667
00668
00669 nic_write(NIC_PG3_EECR, NIC_EECR_EEM0 | NIC_EECR_EEM1);
00670
00671
00672
00673
00674 nic_write(NIC_PG3_CONFIG3, 0);
00675
00676
00677
00678
00679
00680
00681 nic_write(NIC_PG3_CONFIG2, NIC_CONFIG2_BSELB);
00682
00683
00684
00685
00686
00687 nic_write(NIC_PG3_EECR, 0);
00688
00689 Delay_10ms(50);
00690
00691
00692
00693
00694
00695
00696 nic_write(NIC_CR, NIC_CR_STP | NIC_CR_RD2);
00697 nic_write(NIC_PG0_DCR, NIC_DCR_LS | NIC_DCR_FT1);
00698
00699
00700
00701
00702 nic_write(NIC_PG0_RBCR0, 0);
00703 nic_write(NIC_PG0_RBCR1, 0);
00704
00705
00706
00707
00708
00709
00710 nic_write(NIC_PG0_RCR, NIC_RCR_MON);
00711 nic_write(NIC_PG0_TCR, NIC_TCR_LB0);
00712
00713
00714
00715
00716
00717
00718
00719 nic_write(NIC_PG0_TPSR, NIC_FIRST_TX_PAGE);
00720 nic_write(NIC_PG0_BNRY, NIC_STOP_PAGE - 1);
00721 nic_write(NIC_PG0_PSTART, NIC_FIRST_RX_PAGE);
00722 nic_write(NIC_PG0_PSTOP, NIC_STOP_PAGE);
00723
00724
00725
00726
00727 nic_write(NIC_PG0_ISR, 0xff);
00728
00729
00730
00731
00732
00733 nic_write(NIC_CR, NIC_CR_STP | NIC_CR_RD2 | NIC_CR_PS0);
00734 for(i = 0; i < 6; i++)
00735 nic_write(NIC_PG1_PAR0 + i, mac[i]);
00736
00737
00738
00739
00740 for(i = 0; i < 8; i++)
00741 nic_write(NIC_PG1_MAR0 + i, 0);
00742
00743
00744
00745
00746 nic_write(NIC_PG1_CURR, NIC_START_PAGE + TX_PAGES);
00747
00748
00749
00750
00751 nic_write(NIC_CR, NIC_CR_STP | NIC_CR_RD2);
00752
00753
00754
00755
00756
00757 nic_write(NIC_PG0_RCR, NIC_RCR_AB);
00758
00759
00760
00761
00762 nic_write(NIC_PG0_ISR, 0xff);
00763 nic_write(NIC_PG0_IMR, NIC_IMR_PRXE | NIC_IMR_PTXE | NIC_IMR_RXEE |
00764 NIC_IMR_TXEE | NIC_IMR_OVWE);
00765
00766
00767
00768
00769
00770
00771 nic_write(NIC_CR, NIC_CR_STA | NIC_CR_RD2);
00772 nic_write(NIC_PG0_TCR, 0);
00773
00774
00775 Delay_10ms(50);
00776
00777
00778 #endif
00779
00780 NicReset();
00781
00782 debug_print(PSTR("Init controller..."));
00783 nic_write(NIC_PG0_IMR, 0);
00784 nic_write(NIC_PG0_ISR, 0xff);
00785 nic_write(NIC_CR, NIC_CR_STP | NIC_CR_RD2 | NIC_CR_PS0 | NIC_CR_PS1);
00786 nic_write(NIC_PG3_EECR, NIC_EECR_EEM0 | NIC_EECR_EEM1);
00787 nic_write(NIC_PG3_CONFIG3, 0);
00788 nic_write(NIC_PG3_CONFIG2, NIC_CONFIG2_BSELB);
00789 nic_write(NIC_PG3_EECR, 0);
00790
00791 Delay_10ms(200);
00792 nic_write(NIC_CR, NIC_CR_STP | NIC_CR_RD2);
00793 nic_write(NIC_PG0_DCR, NIC_DCR_LS | NIC_DCR_FT1);
00794 nic_write(NIC_PG0_RBCR0, 0);
00795 nic_write(NIC_PG0_RBCR1, 0);
00796 nic_write(NIC_PG0_RCR, NIC_RCR_MON);
00797 nic_write(NIC_PG0_TCR, NIC_TCR_LB0);
00798 nic_write(NIC_PG0_TPSR, NIC_FIRST_TX_PAGE);
00799 nic_write(NIC_PG0_BNRY, NIC_STOP_PAGE - 1);
00800 nic_write(NIC_PG0_PSTART, NIC_FIRST_RX_PAGE);
00801 nic_write(NIC_PG0_PSTOP, NIC_STOP_PAGE);
00802 nic_write(NIC_PG0_ISR, 0xff);
00803 nic_write(NIC_CR, NIC_CR_STP | NIC_CR_RD2 | NIC_CR_PS0);
00804 for(i = 0; i < 6; i++)
00805 nic_write(NIC_PG1_PAR0 + i, mac[i]);
00806 for(i = 0; i < 8; i++)
00807 nic_write(NIC_PG1_MAR0 + i, 0);
00808 nic_write(NIC_PG1_CURR, NIC_START_PAGE + TX_PAGES);
00809 nic_write(NIC_CR, NIC_CR_STP | NIC_CR_RD2);
00810 nic_write(NIC_PG0_RCR, NIC_RCR_AB);
00811 nic_write(NIC_PG0_ISR, 0xff);
00812 nic_write(NIC_PG0_IMR, 0);
00813 nic_write(NIC_CR, NIC_CR_STA | NIC_CR_RD2);
00814 nic_write(NIC_PG0_TCR, 0);
00815
00816 Delay_10ms(200);
00817
00818
00819 nic_write(NIC_CR, NIC_CR_STA | NIC_CR_RD2 | NIC_CR_PS0 | NIC_CR_PS1);
00820 rb = nic_read(NIC_PG3_CONFIG0);
00821 debug_print8(rb);
00822 switch(rb & 0xC0) {
00823 case 0x00:
00824 debug_print(PSTR("RTL8019AS "));
00825 if(rb & 0x08)
00826 debug_print(PSTR("jumper mode: "));
00827 if(rb & 0x20)
00828 debug_print(PSTR("AUI "));
00829 if(rb & 0x10)
00830 debug_print(PSTR("PNP "));
00831 break;
00832 case 0xC0:
00833 debug_print(PSTR("RTL8019 "));
00834 if(rb & 0x08)
00835 debug_print(PSTR("jumper mode: "));
00836 break;
00837 default:
00838 debug_print(PSTR("Unknown chip "));
00839 debug_print8(rb);
00840 break;
00841 }
00842 if(rb & 0x04)
00843 debug_print(PSTR("BNC\x07 "));
00844 if(rb & 0x03)
00845 debug_print(PSTR("Failed\x07 "));
00846
00847
00848
00849
00850
00851
00852
00853 rb = nic_read(NIC_PG3_CONFIG2);
00854 debug_print8(rb);
00855 switch(rb & 0xC0) {
00856 case 0x00:
00857 debug_print(PSTR("Auto "));
00858 break;
00859 case 0x40:
00860 debug_print(PSTR("10BaseT "));
00861 break;
00862 case 0x80:
00863 debug_print(PSTR("10Base5 "));
00864 break;
00865 case 0xC0:
00866 debug_print(PSTR("10Base2 "));
00867 break;
00868 }
00869
00870
00871 return;
00872
00873
00874
00875
00876 writeRTL( ISR, readRTL(ISR) ) ;
00877 Delay_10ms(5);
00878
00879 writeRTL(CR,0x21);
00880 Delay_1ms(2);
00881 writeRTL(DCR, DCR_INIT);
00882 writeRTL(RBCR0,0x00);
00883 writeRTL(RBCR1,0x00);
00884 writeRTL(RCR,0x04);
00885 writeRTL(TPSR, TXSTART_INIT);
00886 writeRTL(TCR,0x02);
00887 writeRTL(PSTART, RXSTART_INIT);
00888 writeRTL(BNRY, RXSTART_INIT);
00889 writeRTL(PSTOP, RXSTOP_INIT);
00890 writeRTL(CR, 0x61);
00891 Delay_1ms(2);
00892 writeRTL(CURR, RXSTART_INIT);
00893
00894 writeRTL(PAR0+0, MYMAC_0);
00895 writeRTL(PAR0+1, MYMAC_1);
00896 writeRTL(PAR0+2, MYMAC_2);
00897 writeRTL(PAR0+3, MYMAC_3);
00898 writeRTL(PAR0+4, MYMAC_4);
00899 writeRTL(PAR0+5, MYMAC_5);
00900
00901 writeRTL(CR,0x21);
00902 writeRTL(DCR, DCR_INIT);
00903 writeRTL(CR,0x22);
00904 writeRTL(ISR,0xFF);
00905 writeRTL(IMR, IMR_INIT);
00906 writeRTL(TCR, TCR_INIT);
00907
00908 writeRTL(CR, 0x22);
00909 }
00910
00911
00912 void processRTL8019Interrupt(void)
00913 {
00914 volatile unsigned char *base = (unsigned char *)0x8300;
00915 unsigned char byte = readRTL(ISR);
00916
00917 if( byte & (1<<ISR_OVW) )
00918 overrun();
00919
00920 }
00921
00922
00923
00924
00925
00926
00927
00928
00929
00930
00931
00932
00933
00934
00935
00936