Make sure you've disable low votage programming (#FUSES NOLVP) p. -- Phillip M. Vogel, President | "It's not what you've been taught, Bartal Design Group, Inc. | it's what you've learned." (me) 318 Marlboro Road | +1-201-567-1343 FAX:+1-201-568-2891 Englewood, NJ 07631 USA | phillip@bartal.com Johan Fredriksson wrote: > > 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