I knew I should have posted my code but I was on a different computer at the time. The first is the program I have tried, with it, GPIO.4 works properly but GPIO.5 remains HIGH always. There's no short btwn any pins, I'm using a clean breadboard.
Code:POR ADCON0=0 VRCON=0 OPTION_REG.5=0 OPTION_REG.7=1 CMCON=7 TRISIO=%00001000 LED1 var GPIO.0 LED2 VAR GPIO.1 LED3 VAR GPIO.2 LED4 VAR GPIO.4 LED5 VAR GPIO.5 PAUSE 50 loop: 'scroll test pattern high led1 pause 75 LOW LED1 PAUSE 50 high led2 PAUSE 75 LOW LED2 PAUSE 50 HIGH LED3 PAUSE 75 LOW LED3 PAUSE 50 high led4 PAUSE 75 LOW LED2 PAUSE 50 HIGH LED5 PAUSE 75 LOW LED3 PAUSE 50 goto loop
The code below is based on your reply (which I appreciate) and it makes GPIO.4 and GPIO.5 remain HIGH at all times. I have tried compiling in both PM and mpasm. Also, I have the MCLR disabled in EPIC'c configuration. I'm not using an ext. osc.
So I must be doing something wrong or missing something ? If I remove ANSEL GPIO.4 works ???Code:TRISIO=%00000 CMCON=%00000111 ANSEL=%00000000 @ DEVICE pic12F675, INTRC_OSC_NOCLKOUT @ DEVICE pic12F675, WDT_ON @ DEVICE pic12F675, PWRT_ON @ DEVICE pic12F675, MCLR_OFF @ DEVICE pic12F675, BOD_ON LED1 var GPIO.0 LED2 VAR GPIO.1 LED3 VAR GPIO.2 LED4 VAR GPIO.4 LED5 VAR GPIO.5 PAUSE 50 loop: 'scroll test pattern high led1 pause 75 LOW LED1 PAUSE 50 high led2 PAUSE 75 LOW LED2 PAUSE 50 HIGH LED3 PAUSE 75 LOW LED3 PAUSE 50 high led4 PAUSE 75 LOW LED2 PAUSE 50 HIGH LED5 PAUSE 75 LOW LED3 PAUSE 50 goto loop
This is just a way for me to learn to use GPIO.4 and 5 and plan to use them in another program later.
Thanks for the help !






Bookmarks