Stefan, If I'm not mistaken, the '671 is *not* a 12 bit, but rather a 14 bit core device. Therefore, try manipulating the GPIO's actual TRIS register, instead of trying to use the 'TRIS' instruction. See if that doesn't help. Good Luck, Chuck Mauro > -----Original Message----- > From: Stefan Rousseau [SMTP:stefanr@RRS.CO.ZA] > Sent: Wednesday, May 06, 1998 7:45 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: PIC 12C671 GPIO control > > Hi > > This did not solve my GPIO problem. Does anybody else have any > advice? > I am trying a simple application for a 12C671 using MPLAB 3.40. > Trouble is I cannot seem to get the I/O's to toggle under the > simulator (no change in the gpio SFR) by > > #define DOUT GPIO,2 ; SPI port DOUT signal > ... > bsf STATUS,RP0 ; set file register bank to > 1 > movwf OSCCAL ; update register with > factory cal value > movlw b'11001000' ;Internal clk,prescaler to wdt > movwf OPTION_REG ; > movlw b'00001001' ; > movwf TRISIO ; port 0, 3 are inputs, rest > outputs > > bcf STATUS,RP0 ; set file register bank to > 0 > bsf DOUT; > bcf DOUT; > ... > > Could somebody please point out my error to me? > > Stefan Rousseau > stefanr@rrs.co.za > Technopark > Stellenbosch > South Africa > > > > ---------- > From: Kalle Pihlajasaari[SMTP:kalle@DEVICE.DATA.CO.ZA] > Sent: Wednesday, May 06, 1998 12:29 PM > Subject: Re: PIC 12C671 GPIO control > > Hi Stefan, > > > I am new to PICs so please excuse any blatant ignorance.... I am > trying = > > a simple application for a 12C671 using MPLAB 3.40. Trouble is I > cannot = > > seem to get the I/O's to toggle under the simulator (no change in > the = > > gpio SFR) by=20 > > Not sure what the simulator should be doing here but the hardware will > not work as you have programmed it. > > > movlw b'00001001' ; > > movwf TRISIO ; port 0, 3 are inputs, > rest = > > outputs > > The 12C671 is almost certainly a 12bit core like the 12C508/9 which I > have > used. They do not use the TRISIO register as a regular register. > > You have to use the TRIS instruction. Best you examine the short > one page opcode listing to check which special opcodes are supported > when changing between 12, 14 or 16 bit programming. > > Cheers