overwrite porta


Closed Thread
Results 1 to 4 of 4

Thread: overwrite porta

  1. #1
    Join Date
    Jan 2005
    Posts
    72

    Default overwrite porta

    hello

    in a little subroutine i have an effect which i can't unterstand.
    set first one bit from a.0 to a.3 to high (part1 in code) and the manipulate only a.5 (part2). but the instruction to set a.5 high, clears the active output from porta set in part1. but both should be set after that...
    thanks for a support

    gabel var porta.5

    init: clear
    TRISA = %00000000
    TRISB = %00000000
    TRISC = %01110000
    PORTA = 0
    PORTB = 0
    PORTC = 0
    low gabel

    main:
    ...

    GOTO main

    lamp:
    ' ----- part 1 -----
    PORTA = 0
    PORTB = 0
    porta.0[taster-8] = 1 ' between a.0 und a.3

    ' ----- part 2 -----
    high gabel ' a.5
    pause 500
    low gabel

    GOTO main

  2. #2
    Join Date
    Sep 2004
    Location
    Mentor, Ohio
    Posts
    352


    Did you find this post helpful? Yes | No

    Default Port A problems

    Hi Mischl,

    I'll save the more experienced people the reply.

    1. What MCU are you using?
    2. Does it have an analog port?
    3. Did you disable the analog port and make it digital?
    4. Did you disable the comparators if they're on your MCU?
    5. Did you read the MCU data sheet?

    There are enough posts on this forum to answer your questions and also give you the answers to the above.

    Excuse me if this sounds like a smart ass but usually anything out of the ordinary happening with port A can be blamed on not changing the port to digital and disabling the analog feature and the comparators.

    BobK.

  3. #3
    Join Date
    Jan 2005
    Posts
    72


    Did you find this post helpful? Yes | No

    Default

    ok, thanks.
    it is ever the same : first i don't find anything and think this must be a new problem (because trisa=0 makes all i need)! and then when i know there is a mistake at me, i find the informations very quick... ;-)

    adcon1 = 7 ' switch from analog to digital

    nice description :
    http://www.picbasic.co.uk/forum/showthread.php?t=561

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    depending of your PIC dude! wich one you play with!!

    Quote Originally Posted by BobK
    3. Did you disable the analog port and make it digital?
    4. Did you disable the comparators if they're on your MCU?
    5. Did you read the MCU data sheet?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. error worring pbp247
    By chai98a in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 17th January 2010, 04:51
  2. PortA digita input?
    By MOUNTAIN747 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th January 2009, 21:55
  3. 16f876 PortA set-up trouble?
    By ronjodu in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 18th February 2006, 19:31
  4. Can anyone help a beginner in a struggle?
    By douglasjam in forum mel PIC BASIC
    Replies: 1
    Last Post: - 5th May 2005, 23:29
  5. 4-line LCD Help - using PortA instead of B
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 28
    Last Post: - 31st March 2005, 03:14

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