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

Translate This Thread From English to

Threaded View


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


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



On Fri, 08 Jul 2005 20:15:10 -0000, the renowned
nad@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"
speff@interlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

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



nad@acuraembedded-dot-com.no-spam.invalid (Nadeem) wrote in


Your main needs to end with an infinite loop

Scott

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





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




Site Timeline