Hi, I need to build a test equipment for a later project. I need a three phase square wave generator running at 50 Hz. No problem with that. I wrote the code simulated it in MPLAB 3.22.02 (MPSIM 6.20.01) works fine. Programmed a JW part and got the signals alright EXCEPT the GP2 which is allways zero. I broke down the code to a minimum, just as a try to isolate the problem. I programmed an other JW part and even wasted an OTP, all with the same result. AFAIK the GP2 is bidirectional, so why can I make this working ? ;3phase Ver. 1.00 ; Pin Port Func. Comment ; 1 VDD +5VDC ; 2 GP5 I FQ Input 50/60 Hz ; 0=50 Hz / 1=60 Hz ; 3 GP4 O -- N/A OUTPUT ; 4 GP3 I -- N/A Connect to +5 ; 5 GP2 O Wout ; 6 GP1 O Vout ; 7 GP0 O Uout ; 8 VSS 0V LIST P=12C509, R=DEC INCLUDE "p12C509.inc" __FUSES _MCLRE_OFF & _CP_OFF & _WDT_OFF & _IntRC_OSC ; PORT GPIO Bit Wout equ 2 Vout equ 1 Uout equ 0 FQ equ 5 ;RAM waitcnt_H equ 0x08 ; waitcnt_L equ 0x09 ; ;****************************************************************** ORG 0x000 init movwf OSCCAL ; Calibrate ! ; 76543210 movlw b'11101000' ; select input pins (1=IN) tris GPIO ; make pins input ;****************************************************************** ;Test code loop bcf GPIO, Uout ; 0 bcf GPIO, Vout ; 0 bcf GPIO, Wout ; 0 bsf GPIO, Uout ; 1 bsf GPIO, Vout ; 1 bsf GPIO, Wout ; 1 goto loop ;****************************************************************** ORG 0x3ff ; movlw 0x80 ; Remove if OTP ;****************************************************************** END Best regards Bjarne Nebelong nebelong@algonet.se