Configuring the GPIO.3/MCLR Pin


Closed Thread
Results 1 to 12 of 12
  1. #1

    Default Configuring the GPIO.3/MCLR Pin

    What would the command be to configure the 12F675 to use the GPIO.3 pin as an input all the time. The programmer keeps defaulting back to MCLR.

  2. #2
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello CocoaColaKid,

    CCK>What would the command be to configure the 12F675 to use the GPIO.3 pin as an input all the time. The programmer keeps defaulting back to MCLR.<<

    There is no command. BUT! on your source code for your compiler you can put the command...to make sure your programmer keeps it to "input". PUt it at the top of your program.


    @ DEVICE PIC12F675,MCLR_OFF or..
    @ DEVICE PIC12F675,MCLR_ON. Which ever way you want.

    If you look in the INC file of the 12F675, you can see all the control switches...

    Doing this will take a little extra room in your file, but hey...its worth it to me.

    This is also in the FAQ Section too.

    Dwayne
    Last edited by Dwayne; - 28th July 2004 at 20:29.
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  3. #3


    Did you find this post helpful? Yes | No

    Default

    Thanks Dwayne, I knew it would be something like that or actually I thought it would be a register.

  4. #4
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello CocaColaKid,

    CCK>Thanks Dwayne, I knew it would be something like that or actually I thought it would be a register.<<

    You are very welcome. Enjoy yourself, and hope your project gets done like it is supposed to!


    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  5. #5


    Did you find this post helpful? Yes | No

    Default

    Dwayne,

    Can I leave this pin open or do I have to tie it somewhere? I would like to be able to minimize my part count and it seems that if I don't use a resistor pulled high I get mixed results. If I tie it to the Vdd it works great. Any ideas?

    Also, would the internal pull up resistors have enough umf to work for a pull up on a Dallas DS1820? Again trying to minimize part count.

  6. #6
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello CocaColaKid,

    CCK>>Can I leave this pin open or do I have to tie it somewhere? I would like to be able to minimize my part count and it seems that if I don't use a resistor pulled high I get mixed results. If I tie it to the Vdd it works great. Any ideas?<<

    I always have the MCLR set as a input, and have had no problem. If it is set as a MCLR, you chip may or maynot work, depending on how you touch it... or things around it <g>. For a guarntee work, use a pull-up resister if you set it to MCLR instead of Input.

    Some folks will go as far as putting a Pull-up there anyhow...I say try it... and if necessary do it.

    CCK>>Also, would the internal pull up resistors have enough umf to work for a pull up on a Dallas DS1820? Again trying to minimize part count<<

    I have not used a DS1820, but my guess, is that they do have enough Umph. I try to use the Internal Pullups whenever I can... I am like you.... the fewer the parts the better.

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  7. #7


    Did you find this post helpful? Yes | No

    Default

    It's strange that you say this because these are the results that I am running into. Even if I configure the port as an input it still take forever to start up. Then when it does start I get random characters being injected into the serial output of the problem. If I drop a 4.7k resistor between it and +5V everything works great. I'm just now wondering if I ground it instead what the results would be? I'll have to try that and find out.

  8. #8
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello CocaColaKid,

    CCK>>It's strange that you say this because these are the results that I am running into. Even if I configure the port as an input it still take forever to start up.<<

    Humm....It should be singing Dixie...

    CCK>> Then when it does start I get random characters being injected into the serial output of the problem. <<

    Ok, you may have a sync problem there. You may want to send a few nulls. to the serial to sync up the communication.

    CCK>>If I drop a 4.7k resistor between it and +5V everything works great.<<

    is your chip being turned on from 5 volts on another pin??? That 675 can run without the VCC connected up, and another pin connected to 5 volts.


    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  9. #9


    Did you find this post helpful? Yes | No

    Default

    >>Ok, you may have a sync problem there. You may want to send a few nulls. to the serial to sync up the communication.

    I'm not sure what you mean here. The serial line is:

    serout2 gpio.0,16780,["TEMP=",s2,dec3 temp/10,".",dec1 temp//10,223,"C "]

    This is tied to a backpack LCD so I can see what is happening. When the MCLR is tied to the rail it works flawless. Remove the resistor and get mixed results. Sometimes it stops, sometimes I get garbage characters in the serial output. I think I'll stick with using the resistor since it works perfect with it.

    >>is your chip being turned on from 5 volts on another pin??? That 675 can run without the VCC connected up, and another pin connected to 5 volts.

    Nope, I have pin 8 going to ground and pin 1 going to the +5V rail.

    I'm now going to try using the internal resistors with this DS1820 and see what happens. Hopefully it will work properly. I'll post my results.

  10. #10
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello CocaColaKid,

    CCK>>This is tied to a backpack LCD so I can see what is happening. When the MCLR is tied to the rail it works flawless. Remove the resistor and get mixed results. Sometimes it stops, sometimes I get garbage characters in the serial output. I think I'll stick with using the resistor since it works perfect with it.<<

    I am sorry, but I guess I don't have a answer for you on that MCLR one. The only thing I can think of, is the programmer does not have MCLR set to "Input". But if a resister works...sometimes we can say "Thats it".

    CCK>>I'm now going to try using the internal resistors with this DS1820 and see what happens. Hopefully it will work properly. I'll post my results.<<

    Yes, tell me the results. I will be very interested on how that DS1820 preforms...

    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

  11. #11


    Did you find this post helpful? Yes | No

    Default

    Do I set the WPU to %01000000 or %00000010 when I have the data line connected to gpio.1? I presuming its that later of the two but I want to make sure. The datasheet indicates that it bit 1 should be 1.

  12. #12
    Join Date
    Dec 2003
    Location
    Wichita KS
    Posts
    511


    Did you find this post helpful? Yes | No

    Default

    Hello CocaColaKid,

    CCK>>Do I set the WPU to %01000000 or %00000010<<

    Always start from the right LSB...One thing to remember, turn off your Comparators. GPIO.0 and GPIO.1 (if I remember correctly) are also your Comparators.

    I would hex "all" the Weak Pull Ups. but if you don't want to.....%00000011 will do it.


    CCK>> when I have the data line connected to gpio.1? I presuming its that later of the two but I want to make sure. The datasheet indicates that it bit 1 should be 1.<<

    I don't have the datasheet in front of me, but Bit one mean the first bit? or the Bit counting from Bit 0. <g>. Thus, turn both bit zero and 1 on, and you got yourself covered until it is working. Then try turning off Bit zero, and see if it runs.


    Dwayne
    Ability to Fly:
    Hurling yourself towards the ground, and missing.

    Engineers that Contribute to flying:
    Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute

    Pilots that are Flying:
    Those who know their limitations, and respect the green side of the grass...

Similar Threads

  1. Is this a K Type sensor?
    By jessey in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 21st November 2009, 13:55
  2. DS1820 with 16f688
    By jessey in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 23rd May 2009, 05:07
  3. Advice-scrutiny for my serial controller
    By kevlar129bp in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 13th December 2008, 17:11
  4. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  5. Another RTC, DS1287
    By DavidK in forum Code Examples
    Replies: 0
    Last Post: - 12th December 2006, 17:07

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts