'The ATmega32 is used. $regfile = "m32def.dat" $crystal = 4000000 Config Lcd = 16 * 2 Config Lcdpin = Pin , Db4 = Portb.0 , Db5 = Portb.1 , Db6 = Portb.2 , Db7 = Portb.3 , E = Portb.4 , Rs = Portb.5 Config Int0 = Falling Config Portd.2 = Input Config Portd.6 = Output Config Portd.5 = Input Config Portd.7 = Output Config Portb.6 = Output Rxf Alias Pind.2 Rd Alias Portd.6 Txe Alias Pind.5 Wr Alias Portd.7 Led Alias Portb.6 Dim Usbin As Byte Dim Readusbfifoflag As Bit Set Rd Reset Wr On Int0 Setreadusbfifoflag Enable Interrupts Enable Int0 Cls Lcd "readonint/wrt..." Lowerline Set Led Waitms 500 Reset Led Waitms 500 Do Set Led Waitms 1000 Reset Led Waitms 1000 If Readusbfifoflag = 1 Then Reset Readusbfifoflag Do Config Portc = Input Do Loop Until Rxf = 0 Reset Rd Usbin = Pinc Set Rd 'apparently hyperterm sends characters 'with upper bit random on or off... Usbin = Usbin And &B01111111 Lcd Chr(usbin) Config Portc = Output Do Loop Until Txe = 0 Set Wr Portc = Asc(usbin) Reset Wr Lcd Chr(usbin) Loop Until Rxf = 1 End If Loop Setreadusbfifoflag: Set Readusbfifoflag Return End