porta.0 and porta.2 only goes high with HIGH command with PIC18F45K80


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Jan 2013
    Location
    Texas USA
    Posts
    229


    Did you find this post helpful? Yes | No

    Default Re: porta.0 and porta.2 only goes high with HIGH command with PIC18F45K80

    This might be a read-modify-write issue.
    The 18FK4580 has Output Latch registers.
    You should try writing to the port via the LATA register instead of the PORTA register.
    Regards,
    TABSoft

  2. #2
    Join Date
    Dec 2014
    Posts
    12


    Did you find this post helpful? Yes | No

    Default Re: porta.0 and porta.2 only goes high with HIGH command with PIC18F45K80

    After taking a quick look in the datasheet it seems like that coulld be it.
    I will test that tomorrow.
    Thanks.

  3. #3
    Join Date
    Sep 2010
    Location
    Las Vegas, NV
    Posts
    305


    Did you find this post helpful? Yes | No

    Default Re: porta.0 and porta.2 only goes high with HIGH command with PIC18F45K80

    You don't say what you've got hooked up to the port pins. Could you post a schematic?

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


    Did you find this post helpful? Yes | No

    Default Re: porta.0 and porta.2 only goes high with HIGH command with PIC18F45K80

    Make sure to disable comparators & ECCP module. Using HIGH /LOW commands disables all analog (generally) for you. PICs default to Analog inputs and you have to be sure to turn it all off to get digital to work. And it makes sense too, analog inputs are incapable of causing any "unintended" actions downstream, like shorting something out or causing a machine to suddenly start running on power up. It is for THAT reason you should set your port states prior to assigning TRIS to outputs.
    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.

  5. #5
    Join Date
    Dec 2014
    Posts
    12


    Did you find this post helpful? Yes | No

    Default Re: porta.0 and porta.2 only goes high with HIGH command with PIC18F45K80

    Setting the outputs with latx.x instead of portx.x solved the problem.
    Tanks.

  6. #6
    Join Date
    Jan 2013
    Location
    Texas USA
    Posts
    229


    Did you find this post helpful? Yes | No

    Default Re: porta.0 and porta.2 only goes high with HIGH command with PIC18F45K80

    Glad to hear this got you moving ahead.

    There are plenty of posts on this forum regarding read-modify-write as well as a straight internet search on the subject if you want to understand the issue better.
    Regards,
    TABSoft

Similar Threads

  1. PortA Doesn't Work
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 11
    Last Post: - 8th September 2015, 18:41
  2. Replies: 10
    Last Post: - 14th April 2014, 20:47
  3. high voltage high frequency H-Bridge
    By George in forum Off Topic
    Replies: 6
    Last Post: - 27th April 2009, 11:50
  4. AD works in Porta.0 but not in porta.1
    By ruijc in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 19th February 2008, 20:22
  5. turning gpio.0 high after pwm command
    By sirvo in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 21st February 2007, 18:22

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