Not familliar with the CCS compiler, but just as a thought, its serial comms library dosen't use pin B4 for flow control does it? Cheers Mike > -----Original Message----- > From: Johan Fredriksson [SMTP:infinity@TELIA.COM] > Sent: Monday, July 17, 2000 1:25 PM > To: PICLIST@MITVMA.MIT.EDU > Subject: PIC hangs on I/O operation > > I've tried this on 12C509A and 16F877 with the same result. I'm just > looping > forever reading two pins and sending a text on RS-232. I'm using CCS > compiler for coding. > > while (-1){ > if (INPUT(PIN_B3)){ > printf("B3 High\n\r"); > } else { > printf("B3 Low\n\r");} > delay_ms(250); > > if (INPUT(PIN_B4)){ > printf("B4 High\n\r"); > } else { > printf("B4 Low\n\r");} > delay_ms(250); > } > > Pin B3 gets a logic 1 (4.95V) or 0 (0.01V) and pin B4 is always high. The > input to B3 comes from a Hall-effect switch. When it detects a magnet it > gows low and when magnet is removed it goes, of course, high again > (pull-up > to +5V and the Hall acts like a transistor driving to ground). The logic > output is OK all the time. > > When removing the magnet so it goes high again the PIC is dead. But not > compleatly dead! If I add the magnet again so it goes low the PIC > continues > from where it was again. > > Anyone having some hints or ideas? I'm very confused now :-) > > /Johan > > -- > http://www.piclist.com hint: PICList Posts must start with ONE topic: > [PIC]: PIC only [EE]: engineering [OT]: off topic [AD]: advertisements -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]: PIC only [EE]: engineering [OT]: off topic [AD]: advertisements