> -----Original Message----- > From: pic microcontroller discussion list > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Tom > Sent: Thursday, March 13, 2003 5:22 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: [PIC]: BCF or MOVLW on TRISx > > > Hi, > > I have PORTD pull high. > Initialization: MOVLW 00H > MOVWF PORTD > MOVLW FFH > MOVWF TRISD ;set all input > > I'm wondering if a single pin of portD can be > toggle input or output by using BCF, > e.g > BCF TRISD,7 ; to set bit 7 of portD as output > > The above don't seem to work. > > However, if i use: > MOVLW 7FH > MOVWF TRISD > > I measure and confirmed that pin 7 of portD goes low. > > Is it that BCF cannot be used? > Specify WHICH processor. The TRIS register is mapped in some of the older precessors. I do this trick on the 18C452s with no problems. I use the direction of the port pins as a tristate. * | __O Thomas C. Sefranek WA1RHP@ARRL.NET |_-\<,_ Amateur Radio Operator: WA1RHP (*)/ (*) Bicycle mobile on 145.41, 448.625 MHz http://hamradio.cmcorp.com/inventory/Inventory.html http://www.harvardrepeater.org > > -- > http://www.piclist.com hint: PICList Posts must start with ONE topic: > [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads > > -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads