Hi all I need help with 12c508, i am loosing it

I have a 12f508 and trying initialize it
every think works except the GP2 pin i need it to work as an out put. but it just doesnt work . I have
tried everything. I think it is somthing to do with the timer0 but i dont know what.
anyways this is how i have initialized it.
#include <12c508A.h> #fuses     INTRC,NOWDT,NOPROTECT,NOMCLR #use     delay(clock = 4000000) #use     fast_io(B) void main() {     int8 turnoffdelay = shutdwn_delay_min;    //shutdown delay variable     int8 MainPower_off;     int1 pinstatus;                //stores the GP0 status     int1 toggle; set_tris_B(0x29);                 output_B(0x00);
PLS HElp I WILL REALY APRECIATE IT Thanks Nadeem
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
On Fri, 08 Jul 2005 20:15:10 -0000, the renowned snipped-for-privacy@acuraembedded-dot-com.no-spam.invalid (Nadeem) wrote:

This is not the correct newsgroup.
But anyway, you will need to set the OPTION register. See the datasheet.
Also note that the 12C508 is not the same as the 12F508 in every respect (you refer to both).
Best regards, Spehro Pefhany
--
"it's the network..." "The Journey is the reward"
snipped-for-privacy@interlog.com Info for manufacturers: http://www.trexon.com
  Click to see the full signature.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
snipped-for-privacy@acuraembedded-dot-com.no-spam.invalid (Nadeem) wrote in

Your main needs to end with an infinite loop
Scott
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

I don't see anything in your code that sets the option register. As I recall, it defaults to use GP2 as a clock source on reset. This would make it an input pin and disregard the TRIS bits.
Mark Walsh
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.