CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

12f629 woes, where oh where have the pull-ups gone?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
curt



Joined: 23 Apr 2004
Posts: 4

View user's profile Send private message

12f629 woes, where oh where have the pull-ups gone?
PostPosted: Thu May 27, 2004 12:24 pm     Reply with quote

No matter what I try (including writing my own #asm) GP1 refuses to be pulled up. When I wire up my own 4.7K on it everything is just peachy, port_a_pullups(true) and setup_counters(...) don't seem to help.

Its dropping into my Morlock board (http://www.exarin.com) and I already have a bunch of blanks so I can't change wiring (was using 12ce519)

Any help would be appreciated.

-Curt
curt



Joined: 23 Apr 2004
Posts: 4

View user's profile Send private message

oh yeah one other thing-
PostPosted: Thu May 27, 2004 12:28 pm     Reply with quote

Using MPLAB 6.5 has 2 internal clock options, one runs the clock external and the other does not. using:

#fuses NOWDT, PROTECT, INTRC, NOMCLR, BROWNOUT, CPD, NOWDT

maps to "Internal RC No Clockout" but I want no clock out! I'm using that pin! Manually changing it each time I load the hex image is annoying, what fuse am I missing?

-Curt
Charlie U



Joined: 09 Sep 2003
Posts: 183
Location: Somewhere under water in the Great Lakes

View user's profile Send private message

PostPosted: Thu May 27, 2004 4:04 pm     Reply with quote

For the fuse, look at "Valid Fuses" under View in the main menu of the IDE. The one you are looking for is INTRC_IO.

As to the pull up problem, take a look at the readme file. Here's a quote:

New capabilities for the 629,630,675,676 chips:
The PORT_B_PULLUPS function accepts a number like SET_TRIS_B
to enable specific pins. For some chips this function is
named PORT_A_PULLUPS.

TRUE is defined as 1. From the above, I would surmise that only the pull lup for GPIO0 is being enabled. Try PORT_A_PULLUPS(0x02) to enable the pullup for GPIO1.

See if this helps.
curt



Joined: 23 Apr 2004
Posts: 4

View user's profile Send private message

Thanks!
PostPosted: Sat May 29, 2004 6:03 pm     Reply with quote

I don't use the IDE to compile with, perhaps I should start Smile

Both suggestions did the trick, thank you so very much for the RTFM headsup Smile

-Curt
Ttelmah
Guest







Re: Thanks!
PostPosted: Sun May 30, 2004 2:20 am     Reply with quote

curt wrote:
I don't use the IDE to compile with, perhaps I should start Smile

Both suggestions did the trick, thank you so very much for the RTFM headsup Smile

-Curt

This is a case where a little more 'thought' by CCS, could potentially avoid the problem. Technically, in C, 'true', is a non-zero value. CCS define it in the processor include files as 1. In quite a few C's, the definitions are instead '(!false)', with false allready defined as zero. The nice thing about changing the definition to this form, is that for the pull-ups, the value being passed when 'true' is selected, would not become 255, ensuring that the 'old' syntax, of 'port_b_pullups(true)', would still work, and turn on all eight pull-ups (if present).
For anyone who wants to retain the old syntax, I'd suggest changing the 'true' definition to this form (it wastes no space, the compiler calculates the value during compilation, and no more work is needed at run time), or simply to change the value defined for true to 255. Another common form in different compilers, is to define 'true' as -1, which again results in all bits being on.

Best Wishes
Guest








PostPosted: Sun Apr 17, 2005 10:27 am     Reply with quote

grateful for the explanation on the PULLUPS of 12F629

grateful Ttelmah friend

Dumaster
dumaster



Joined: 17 Apr 2005
Posts: 1

View user's profile Send private message

Thanks
PostPosted: Sun Apr 17, 2005 10:28 am     Reply with quote

grateful for the explanation on the PULLUPS of 12F629

grateful Ttelmah friend

Dumaster
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Sun Apr 17, 2005 10:37 am     Reply with quote

Quote:
including writing my own #asm


Well I would have thought this would have worked as far as setting up the pullups?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group