On 20/06/2011 23:18, jim@jpes.com wrote: > Let me try this again without all the typos and spelling mistakes. > That's what I get for going too fast. > > All, > > I am trying to get familiar with the PIC16F1827 part that has the > Capacitive Sensing Module on it. > As a start, I am setting each bit on PORTB sequentially. This is just > a familiarization exercise. > However, I can't get bits 1,2 and 5 to toggle. I have tried turning > off any module associated with > PORTB, but I still cannot get it to work. Bits 0, 3, 4, 6, and 7 work > fine. > I am probably missing turning off something, but I just don't see what > it is. > > Below is listed what I have tried turning off so far. > > clrf PORTB ; Clear the PORT > > movlw 0x01 ; Make pins OUTPUTS > movwf 0x08 > clrf TRISB > movlw 0x00 > movwf 0x08 > > movlw 0x03 ; Disable Serial Port (UART) > movwf 0x08 > bsf RCSTA,7 > movlw 0x00 > movwf 0x08 > > movlw 0x03 ; Make Pins Digital, Not Analog > movwf 0x08 > bcf ANSELB,7 > movlw 0x00 > movwf 0x08 > =09 > movlw 0x04 ; Turn Off Synchronous Serial Ports (SPI& I2C) > movwf 0x08 > clrf SSP1CON1 > clrf SSP2CON1 > movlw 0x00 > movwf 0x08 > > movlw 0x01 ; Turn Off A/D Converter > movwf 0x08 > clrf ADCON0 > movlw 0x00 > movwf 0x08 > > movlw 0x00 ; Turn Off Capacitive Sense Module > movwf 0x08 > clrf CPSCON0 > movlw 0x00 > movwf 0x08 > > movlw 0x07 ; Turn Off Digital Signal Modulator > movwf 0x08 > clrf MDCON > movlw 0x00 > movwf 0x08 > > movlw 0x02 ; Turn Off D/A Converter Module > movwf 0x08 > clrf DACCON0 > movlw 0x00 > movwf 0x08 > > movlw 0x02 ; Turn Off Comparator Module > movwf 0x08 > clrf CM1CON0 > movlw 0x00 > movwf 0x08 > > If anyone sees anything that I am doing wrong, or sees something that > I am missing turning off > (or on if it should be on) to make PORTB work, please let me know. I > appreciate it. > > Thanks and Regards, > > Jim > > > > Shouldn't that be clrf ANSELB if you want make all the pins digital? Although it shouldn't affect the output.. Couple of guesses: Just checked my datasheet and it says it has more than one I2C/SPI=20 peripheral - check page 126, section 12.3.4 for the pin priorities and=20 see if you can see anything there. I would turn SSPCON2 off to start=20 with, and the CCP peripheral. Check you are not having a rmw issue when you toggle the pins too. --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .