|
|
View previous topic :: View next topic |
Author |
Message |
curt
Joined: 23 Apr 2004 Posts: 4
|
12f629 woes, where oh where have the pull-ups gone? |
Posted: Thu May 27, 2004 12:24 pm |
|
|
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
|
oh yeah one other thing- |
Posted: Thu May 27, 2004 12:28 pm |
|
|
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
|
|
Posted: Thu May 27, 2004 4:04 pm |
|
|
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
|
Thanks! |
Posted: Sat May 29, 2004 6:03 pm |
|
|
I don't use the IDE to compile with, perhaps I should start
Both suggestions did the trick, thank you so very much for the RTFM headsup
-Curt |
|
|
Ttelmah Guest
|
Re: Thanks! |
Posted: Sun May 30, 2004 2:20 am |
|
|
curt wrote: | I don't use the IDE to compile with, perhaps I should start
Both suggestions did the trick, thank you so very much for the RTFM headsup
-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
|
|
Posted: Sun Apr 17, 2005 10:27 am |
|
|
grateful for the explanation on the PULLUPS of 12F629
grateful Ttelmah friend
Dumaster |
|
|
dumaster
Joined: 17 Apr 2005 Posts: 1
|
Thanks |
Posted: Sun Apr 17, 2005 10:28 am |
|
|
grateful for the explanation on the PULLUPS of 12F629
grateful Ttelmah friend
Dumaster |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Sun Apr 17, 2005 10:37 am |
|
|
Quote: | including writing my own #asm |
Well I would have thought this would have worked as far as setting up the pullups? |
|
|
|
|
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
|