16F883/886 Help


Closed Thread
Results 1 to 10 of 10

Thread: 16F883/886 Help

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by plyrathrt View Post
    When I move this to the breadboard, there seems to be a small leakage of current when I release the button to stop the pulsing.

    I am beginning to think it's a problem with the interupts but the datasheet states they are disabled on reset. Below is the beginning of my code.
    Yes, datasheet says interrupts are disabled on reset...
    How about cap's across Vdd/Vss? And maybe a few other sprinkled around between your PIC and the power supply? How stout is your power supply?

  2. #2
    Join Date
    Nov 2007
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    3V. The datasheet shows a minimal 2v.

  3. #3
    Join Date
    Nov 2007
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    Ok, I have found that it is leaking voltage somehow when the pin is told to go low. I tried reversing the pin state to a input instead of lowing it, but it will not flash the LED at all when i do that. So basicly high LED : PAUSEUS 60000 : REVERSE LED will not make it flash.

    Anything I am missing that would cause me no to be able to change the state of that pin?

  4. #4
    Join Date
    Nov 2007
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    Ok, if this thing pisses me off any more, I have the option to move to a 18F2221 or 18F4321.

    How to I put RA0,RA1,RA2,RA3, RB0,RB1, and RB3 as inputs?

    The rest need to be outputs and go HIGH but a couple may need to be flipped to inputs for one reason or another. All inputs and outputs must be digital.

    The 18F is a huge pic that I have absolutely no experience with (and I am only intermediate with 16F and 12F series).

  5. #5
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by plyrathrt View Post

    How to I put RA0,RA1,RA2,RA3, RB0,RB1, and RB3 as inputs?
    RA 7 6 5 4 3 2 1 0
    see bits below
    Code:
    TrisA =%00001111               ' RA  0:3 as inputs RA 4:7 as outputs in binary
    OR
    TrisA = $0F                    ' same thing in HEX
    or
    TrisA = 15                     ' same thing in DECIMAL
    TrisB = %00001011              ' PortB 0,1,3 as inputs

    I like binary because it is easy to see at a glance, 1s are inputs, 0s are outputs
    Edit: Doh!, Port calls hi / low status of output, TRIS register determines Input/Output
    Last edited by Archangel; - 18th August 2008 at 00:55.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  6. #6
    Join Date
    Nov 2007
    Posts
    42


    Did you find this post helpful? Yes | No

    Default

    Setting Tris registers isn't the problem. It's making sure that the inputs are "digital" and the outputs are setup right.

    18F's use the ADCON0, ADCON1 to select pins as digital but it doesn't seem to be working for me.

    I am more concerned with getting the 16F883 working properly because atleast that series I am decent with.

    As you can see, I like binary too. Way easier to understand atleast for me.

Members who have read this thread : 0

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