FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Forum index » Science and Technology » Engineering » Control
Hi all I need help with 12c508, i am loosing it
Post new topic   Reply to topic Page 1 of 1 [4 Posts] View previous topic :: View next topic
Author Message
Nadeem
science forum beginner


Joined: 08 Jul 2005
Posts: 1

PostPosted: Fri Jul 08, 2005 6:15 pm    Post subject: Hi all I need help with 12c508, i am loosing it Reply with quote

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
Back to top
Spehro Pefhany
science forum beginner


Joined: 01 May 2005
Posts: 43

PostPosted: Fri Jul 08, 2005 6:43 pm    Post subject: Re: Hi all I need help with 12c508, i am loosing it Reply with quote

On Fri, 08 Jul 2005 20:15:10 -0000, the renowned
nad@acuraembedded-dot-com.no-spam.invalid (Nadeem) wrote:

Quote:
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

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
Back to top
Scott Seidman
science forum addict


Joined: 05 May 2005
Posts: 62

PostPosted: Fri Jul 08, 2005 6:52 pm    Post subject: Re: Hi all I need help with 12c508, i am loosing it Reply with quote

nad@acuraembedded-dot-com.no-spam.invalid (Nadeem) wrote in
news:11ctnmecttfe318@corp.supernews.com:

Quote:
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


Your main needs to end with an infinite loop

Scott
Back to top
Mark
science forum addict


Joined: 02 May 2005
Posts: 51

PostPosted: Fri Jul 08, 2005 10:13 pm    Post subject: Re: Hi all I need help with 12c508, i am loosing it Reply with quote

"Nadeem" <nad@acuraembedded-dot-com.no-spam.invalid> wrote in message
news:11ctnmecttfe318@corp.supernews.com...
Quote:
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


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
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [4 Posts] View previous topic :: View next topic
The time now is Thu Jan 08, 2009 2:28 pm | All times are GMT
Forum index » Science and Technology » Engineering » Control
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Winning and loosing Geo Incog New Theories 0 Fri Mar 11, 2005 7:13 pm

Mortgages | Mobile Phones | Internet Advertising | Mortgage | Looking for Credit Cards?
Copyright © 2004-2005 DeniX Solutions SRL
Other DeniX Solutions sites: Electronics forum |  Medicine forum |  Unix/Linux blog |  Unix/Linux documentation |  Unix/Linux forums


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1817s ][ Queries: 12 (0.1061s) ][ GZIP on - Debug on ]