I think I posted this too soon. I'm writing it off as a fried PIC. I've use= d this device for a lot of experiments recently, sometimes pushing the limits= .. On at least one occasion I connected the buzzer in reverse polarity. The PIC now also has the following aberration: sbit relay at LATA2_bit; sbit buzz at LATA3_bit; relay =3D 1; then setting buzz =3D 1; resets relay to zero. I have never had an sbit variable affect anything other than its own bit. I'm pretty sure I fried th= e PIC. I'm going to be busy for a few days but when I get a chance I'll try a different PIC. Thanks for your suggestions and comments, Allen Ps: I don't know where all the white space in my post came from. I leave on= e blank line between paragraphs. > -----Original Message----- > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf Of > Allen Mulvey > Sent: Saturday, August 23, 2014 10:20 PM > To: 'Microcontroller discussion list - Public.' > Subject: [PIC] Port Behavior >=20 > I recently moved a project to a PIC18F46K22 and am getting some unexpecte= d > results when using various pins as outputs. The data sheet says: >=20 >=20 >=20 > - High-Current Sink/Source 25 mA/25 mA >=20 >=20 >=20 > I tried testing various PORTA and PORTD pins by driving a small active > buzzer which draws about 7 mA. If the device is connected from the pin to > VCC, it screams when the pin goes low. If I connect the device from the pin > to ground (VSS) nothing happens but an LED indicates the port goes high. Of > course the device polarity is adjusted for each situation. >=20 >=20 >=20 > I tried PORTD because ports A and C have a lot of other things going on and > I wanted to make sure I just hadn't forgotten to turn off some peripheral= .. > PORTD is about as generic as a PIC port can be. >=20 >=20 >=20 > The ports seem to be operating as open collector devices like some other > PICs I have used. I do not see anything in the documentation to suggest this > kind of operation. >=20 >=20 >=20 > I can work with the ports as source only but this seems contrary to the data > sheet which explicitly says Sink/Source. >=20 >=20 >=20 > What am I missing here? >=20 >=20 >=20 > Allen >=20 > -- > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .