Crazy PORT.A Issue


+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 20

Thread: Crazy PORT.A Issue1780 days old

  1. #1
    Harrison
    Guest Harrison's Avatar

    0 Not allowed!

    Default Crazy PORT.A Issue

    This has really got me scratching my head!

    I am using a PIC18F4550 and I am trying to set all the pins on PORTA to a '1' but this is not possible... What? you are thinking.. I will explain what seems to be happening.

    I have LED's with 56R resistors on each of these pins.

    This is my code:

    PORTA.0 = 1
    PORTA.1 = 1
    PORTA.2 = 1
    PORTA.3 = 1
    PORTA.4 = 1

    I can turn on any one LED on it's own but when I try to put them all one the LEDs flash on for a few ms but only the last one in my code actually stays on regardless of which order I put them in or how many I set.

    Anyone encountered this before?

Attention

This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

The advertisements we display are relevant to this web site and your browsing history

Please consider supporting us by disabling your ad blocker.


Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

If you can, please report issues in the forum area WebSite / Forum Issues


Thank you for your attention.

  • #2
    Senior Member Mellbreak's Avatar
    Join Date
    Jun 2012
    Posts
    562
    Thumbs Up
    Received: 36
    Given: 26
    Total Downloaded
    4.47 GB

    0 Not allowed!

    Default Re: Crazy PORT.A Issue

    Hi Harrison,

    A copy of your test code would be handy.

    Bob

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #3
    Harrison
    Guest Harrison's Avatar

    0 Not allowed!

    Default Re: Crazy PORT.A Issue

    I've written a small routine to cycle the LEDs and it does them all in turn no problem but as soon as I try and put them all on nothing happens as PORTA.4 is high when it puts them all on so PORTA.4 just stays high, then back to cycling them again???

    PORTA.0 = 0
    PORTA.1 = 0
    PORTA.2 = 0
    PORTA.3 = 0
    PORTA.4 = 0


    main:


    PORTA.0 = 1
    DelayMS 500
    PORTA.0 = 0


    PORTA.1 = 1
    DelayMS 500
    PORTA.1 = 0


    PORTA.2 = 1
    DelayMS 500
    PORTA.2 = 0


    PORTA.3 = 1
    DelayMS 500
    PORTA.3 = 0


    PORTA.4 = 1
    DelayMS 500
    PORTA.4 = 0


    PORTA.0 = 1
    PORTA.1 = 1
    PORTA.2 = 1
    PORTA.3 = 1
    PORTA.4 = 1


    DelayMS 500


    PORTA.0 = 0
    PORTA.1 = 0
    PORTA.2 = 0
    PORTA.3 = 0
    PORTA.4 = 0




    GoTo main
    Last edited by Harrison; 8th April 2015 at 16:16.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #4
    Harrison
    Guest Harrison's Avatar

    0 Not allowed!

    Default Re: Crazy PORT.A Issue

    This is the complete code:



    Device 18F4550




    Xtal 8


    Declare Hserial_Baud 19200
    Declare Hserial_RCSTA = %10010000
    Declare Hserial_TXSTA = %00100000
    Declare Hserial_Clear = On





    All_Digital true

    Declare Bootloader OFF


    '----------------------------------------------------------------------------------------------------------------------------------------




    Config_Start


    FOSC = INTOSC_XT
    MCLRE=Off
    PLLDIV=1
    WDT=OFF


    Config_End



    Reminders off

    Declare Float_Display_Type = LARGE




    OSCCON.0=0
    OSCCON.1=0
    OSCCON.2=1
    OSCCON.3=1
    OSCCON.4=1
    OSCCON.5=1
    OSCCON.6=1
    OSCCON.7=0



    TRISA=%11100000
    TRISB=%11000000
    TRISC=%10111000
    TRISD=%00101000


    TRISE.0 = 1
    TRISE.1 = 1
    TRISE.2 = 1



    ADCON1=%00000000
    ADCON2=%10110101

    ADCON2.7=1

    PORTA.0 = 0
    PORTA.1 = 0
    PORTA.2 = 0
    PORTA.3 = 0
    PORTA.4 = 0


    main:


    PORTA.0 = 1
    DelayMS 500
    PORTA.0 = 0


    PORTA.1 = 1
    DelayMS 500
    PORTA.1 = 0


    PORTA.2 = 1
    DelayMS 500
    PORTA.2 = 0


    PORTA.3 = 1
    DelayMS 500
    PORTA.3 = 0


    PORTA.4 = 1
    DelayMS 500
    PORTA.4 = 0


    PORTA.0 = 1
    PORTA.1 = 1
    PORTA.2 = 1
    PORTA.3 = 1
    PORTA.4 = 1


    DelayMS 500


    PORTA.0 = 0
    PORTA.1 = 0
    PORTA.2 = 0
    PORTA.3 = 0
    PORTA.4 = 0




    GoTo main

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #5
    Fanatical Contributor Tim's Avatar
    Join Date
    Jan 2003
    Posts
    7,689
    Thumbs Up
    Received: 47
    Given: 95
    Total Downloaded
    1.32 GB

    0 Not allowed!

    Default Re: Crazy PORT.A Issue

    I'm sure this was explained in the past.

    You have have classic read/modify/write issues

    You need to use the lat reg not the port
    Tim

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #6
    Harrison
    Guest Harrison's Avatar

    0 Not allowed!

    Default Re: Crazy PORT.A Issue

    So when I assign Symbols I need to use lat reg?

    I've not come across this before

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #7
    Prolific Poster charliecoultas's Avatar
    Join Date
    Sep 2010
    Posts
    1,384
    Thumbs Up
    Received: 48
    Given: 39
    Total Downloaded
    3.45 GB

    0 Not allowed!

    Default Re: Crazy PORT.A Issue

    Like this:
    • LATA.0 = 1
      LATA.1 = 1
      LATA.2 = 1
      LATA.3 = 1
      LATA.4 = 1

      Charlie





  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #8
    Harrison
    Guest Harrison's Avatar

    0 Not allowed!

    Default Re: Crazy PORT.A Issue

    Great thanks!

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #9
    Senior Member Mellbreak's Avatar
    Join Date
    Jun 2012
    Posts
    562
    Thumbs Up
    Received: 36
    Given: 26
    Total Downloaded
    4.47 GB

    0 Not allowed!

    Default Re: Crazy PORT.A Issue

    This code works for me...

    Code:
    Device = 18F4550
    Xtal = 8
    
    Declare  All_Digital true
    
    Config_Start
    
    
    FOSC = INTOSC_XT
    MCLRE=Off
    PLLDIV=1
    WDT=OFF
    
    
    Config_End
    
    
    OSCCON.0=0
    OSCCON.1=0
    OSCCON.2=1
    OSCCON.3=1
    OSCCON.4=1
    OSCCON.5=1
    OSCCON.6=1
    OSCCON.7=0
    
    TRISA=%11100000
    
    PORTA.0 = 0
    PORTA.1 = 0
    PORTA.2 = 0
    PORTA.3 = 0
    PORTA.4 = 0
    
    main:
    
    
    PORTA.0 = 1
    DelayMS 500
    PORTA.0 = 0
    
    
    PORTA.1 = 1
    DelayMS 500
    PORTA.1 = 0
    
    
    PORTA.2 = 1
    DelayMS 500
    PORTA.2 = 0
    
    
    PORTA.3 = 1
    DelayMS 500
    PORTA.3 = 0
    
    
    PORTA.4 = 1
    DelayMS 500
    PORTA.4 = 0
    
    
    PORTA.0 = 1
    PORTA.1 = 1
    PORTA.2 = 1
    PORTA.3 = 1
    PORTA.4 = 1
    
    
    DelayMS 3000
    
    
    PORTA.0 = 0
    PORTA.1 = 0
    PORTA.2 = 0
    PORTA.3 = 0
    PORTA.4 = 0
    
    
    
    
    GoTo main

    Whlist not doubting the information in previous posts, anyone able to suggest why?

    Bob
    Last edited by Mellbreak; 8th April 2015 at 17:08.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #10
    Harrison
    Guest Harrison's Avatar

    0 Not allowed!

    Default Re: Crazy PORT.A Issue

    Not for me... LAT has resolved my issue completely though!

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #11
    Senior Member Mellbreak's Avatar
    Join Date
    Jun 2012
    Posts
    562
    Thumbs Up
    Received: 36
    Given: 26
    Total Downloaded
    4.47 GB

    0 Not allowed!

    Default Re: Crazy PORT.A Issue

    How interesting. The way to go is clear, but I'd love to know why my code works in this case... small differences in the chips?

    Anyway, glad you got it sorted.

    Bob

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #12
    Senior Member SimonJA's Avatar
    Join Date
    Mar 2006
    Posts
    831
    Thumbs Up
    Received: 14
    Given: 16
    Total Downloaded
    966.48 MB

    0 Not allowed!

    Default Re: Crazy PORT.A Issue

    This came up a few months ago and I thought Les had said that Proton High & Low commands now use LAT to avoid this issue.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #13
    Harrison
    Guest Harrison's Avatar

    0 Not allowed!

    Default Re: Crazy PORT.A Issue

    I don't come here very often to be fair so hadn't noticed. I did a compiler update and ran in to a few changes that I had to implement throughout my projects like adding 'Declare' and changing how 'Dig' is formatted.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #14
    Senior Member Mellbreak's Avatar
    Join Date
    Jun 2012
    Posts
    562
    Thumbs Up
    Received: 36
    Given: 26
    Total Downloaded
    4.47 GB

    0 Not allowed!

    Default Re: Crazy PORT.A Issue

    Out of interest, what version of the compiler are you using Harrison?


    See here (Post 9)....
    http://www.protonbasic.co.uk/showthr...light=port+lat
    Last edited by Mellbreak; 8th April 2015 at 20:02.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #15
    Senior Member SimonJA's Avatar
    Join Date
    Mar 2006
    Posts
    831
    Thumbs Up
    Received: 14
    Given: 16
    Total Downloaded
    966.48 MB

    0 Not allowed!

    Default Re: Crazy PORT.A Issue

    Quote Originally Posted by Harrison View Post
    I don't come here very often to be fair so hadn't noticed. I did a compiler update and ran in to a few changes that I had to implement throughout my projects like adding 'Declare' and changing how 'Dig' is formatted.
    Sorry I didn't mean to criticise you for not reading every post on the forum.

    I just wondered if anyone else could confirm that Les had said that.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

    Thread Information

    Users Browsing this Thread

    There are currently 1 users browsing this thread. (0 members and 1 guests)

       

    Similar Threads

    1. 18F47K40 Port B issue
      By geoff_c in forum Proton Plus Compiler v3
      Replies: 17
      Last Post: 24th January 2019, 07:35
    2. OW is driving me crazy!
      By C_Moore in forum The Lounge
      Replies: 0
      Last Post: 1st March 2009, 01:53
    3. 16F877A Going Crazy
      By fgcity in forum Proton Plus Compiler v3
      Replies: 14
      Last Post: 22nd May 2007, 14:16
    4. CRAZY sale!!!!!!
      By Lester in forum Wanted and For Sale
      Replies: 1
      Last Post: 8th May 2005, 10:50

    Tags for this Thread

    Posting Permissions

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