i need help


Closed Thread
Results 1 to 4 of 4

Thread: i need help

  1. #1
    illas's Avatar
    illas Guest

    Arrow i need help

    i have some problem copy a save temp data to PORTC

    first:

    BANKSEL RCSTA
    movlw 0
    movwf RCSTA

    i will turn off serial port being use in PORTC.

    second:

    BSF STATUS,5
    clrf TRISC
    BCF STATUS,5
    clrf PORTC
    make the portc as output port.

    e.g: already bit set bit0,1,2 then wanna store into a temp file register
    temp inside value will be 0x7. which mean bit,0,1,2 will be in high stats

    movf PORTC,W
    movwf temp ; temp register

    then for some reason want copy back to portc
    movf temp,W
    movwf PORTC

    here the problem i faced, it gave me 0 value in PORTC.
    Help Help Help
    anyone know the problem here ? urgently

    thank you

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


    Did you find this post helpful? Yes | No

    Default

    Assembler //////programmers DEVIL\\\\\\\

    if i read/understand correctly you read from a whole port wich is currently set as output on all pins and then, you want to send the same value to the same portc??? sounds bad to me....

    i'm probably wrong on all but i try to stay as far to the assembler as i can. A brief description of what you want to do and the whole code will be appreciated on PM. i have some spare time and can try to make it work.

    Since it's a PicBasic forum, i doubt that you'll find many answer from many user(exept 2-3) here. the best way i guess is to go to Microchip forum where all "assembler guru's" reside. or post a request on their tech support site... sometimes they answer fast.

    here's the link
    http://support.microchip.com/scripts...=webticketcust
    Last edited by mister_e; - 24th June 2005 at 15:57.
    Steve

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

  3. #3
    illas's Avatar
    illas Guest


    Did you find this post helpful? Yes | No

    Default

    hi steve

    i was doing a project. for some reason i need to copy variable file register to the portc. but anyway i found the mistake i make. i really thank that you willing
    to help me.

  4. #4
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    Illas, The problem is this, you are not writing any thing other than 00h to PortC after setting it to all outputs.

    BSF STATUS,5
    clrf TRISC <---------- sets direction register for ALL output
    BCF STATUS,5
    clrf PORTC <-------------- sets port latch register for 00h

    movf PORTC,W <-------- copy portc to w (portc = 0oh)
    movwf temp ; temp register <----- copy w to temp (w = 00h)

    movf temp,W <-------- copy temp to w (temp = 00h)
    movwf PORTC <-------- copy w to portc (w=00h)

    Where are you setting the individual bits you are talking about?

    Dave Purola,
    N8NTA

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