Direct Register Access not recognized


+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2022
    Posts
    5

    Question Direct Register Access not recognized

    Hello,
    I've been working on a 18F46K80 and am at a point where I want to disable the EUSART receiver. I tried RCSTA1.7 = 0 and I get a compile error. I also tried RCSTA.7 = 0 and RCSTA = 0 with the same result. The confusing part is the very next line addresses the TXSTA1.5 = 0 and the command compiles fine. I have all the modedefs and defines declared and have the 46k80 selected but I can't seem to get past this error. Any help would be greatly appreciated.

    Thanks,
    Paul

  2. #2
    Join Date
    May 2013
    Location
    australia
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default Re: Direct Register Access not recognized

    you will need to post some code that demonstrates that problem
    Warning I'm not a teacher

  3. #3
    Join Date
    Apr 2022
    Posts
    5


    Did you find this post helpful? Yes | No

    Default Re: Direct Register Access not recognized

    Here is the code listing. The compiler complains about the RCSTA1.7 = 0 command. If I comment it out, the rest of the code compiles fine. The error message is "bad expression"

    code:

    recvoff:
    RCSTA1.7 = 0
    while ! TXSTA1.1 :wend 'wait til TX completes
    TXSTA1.5 = 0 'turn off EUSART1 TX
    END SELECT 'done with this
    return

  4. #4
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,533


    Did you find this post helpful? Yes | No

    Default Re: Direct Register Access not recognized

    That code sure doesn't compile but it's not because of RCSTA1.7=0 but rather END SELECT. If I remove END SELECT the reset does compile here.
    Since you claim it compiles if you comment out RCSTA1.7=0 I suspect the code you posted isn't what you're trying to compile - which doesn't help.

    Which version of PBP do you have and which version of MPLAB/MPASM are you using?

    Goto the MPASMX folder and open the file p18f46k80.inc, look for the lines:
    Code:
    RCSTA            EQU  H'0FAB'
    RCSTA1           EQU  H'0FAB'
    Also goto your PBP3 installation folder, open DEVICES and then open PIC17F46K80.PBPINC, look for the lines:
    Code:
    RCSTA1              VAR BYTE EXT     ; BANKA
    RCSTA               VAR BYTE EXT     ; BANKA (Legacy/Migration
    Can you find these entries in both of the above files?

  5. #5
    Join Date
    Apr 2022
    Posts
    5


    Did you find this post helpful? Yes | No

    Default Re: Direct Register Access not recognized

    Hello Henrik,
    you and I have talked about this code a few times now. I had to change my name to protect the guilty! Actually I lost my original password and tried to recover the password but never got a response so I just created a new one.

    Yes, both files are there, and all the declarations are also there. I moved the end select statement so this code should execute no matter what happens above it.

    Code:
    CASE ELSE
    hserout ["Ending changes",13,10]
    write lockadd, word $5A5A       'relock so values don't change.
    END SELECT                           'done with this
    
    
    recvoff:
    RCSTA1.7 = 0                                                                   
    while ! TXSTA1.1 :wend            'wait til TX completes
    TXSTA1.5 = 0                          'turn off EUSART1 TX
    
    
    return
    It still won't compile.
    Thanks,
    Paul

  6. #6
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,533


    Did you find this post helpful? Yes | No

    Default Re: Direct Register Access not recognized

    Hi Paul,
    The following compiles here, using PBP 3.1.6.4 and MPASM 5.87:
    Code:
    recvoff:
      RCSTA1.7 = 0                                                                   
      while ! TXSTA1.1 :wend            'wait til TX completes
      TXSTA1.5 = 0                          'turn off EUSART1 TX
    Try copy/pasting the above code (not your original code, but the above) into a new file and compile it for the 46K80.
    It's a real longshot but I have had weird things happening where some character have not been what it looks like. Can't really explain it but deleting ALL of the offending line and type it again solved the issue.

    /Henrik.

  7. #7
    Join Date
    Apr 2022
    Posts
    5


    Did you find this post helpful? Yes | No

    Default Re: Direct Register Access not recognized

    Thanks Henrik,
    well, you nailed it, and I don't know why. I deleted the original code and inserted yours and it compiled fine. Just for fun I'll look at the ascii code originally there and see if there is a hidden character that was causing the problem. Thanks for all your help with this. I really appreciate it. If I find something hidden, I'll get back to you. Thanks again.

    Paul

Similar Threads

  1. statment not recognized
    By xvladx in forum General
    Replies: 4
    Last Post: - 10th April 2010, 14:07
  2. device not recognized
    By Hylan in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 21st November 2009, 17:21
  3. USB Device Not Recognized ???
    By keymuu in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th October 2008, 00:53
  4. 18f4550 Device not recognized
    By garethconner in forum USB
    Replies: 3
    Last Post: - 22nd December 2007, 03:00
  5. usb device not recognized
    By NL2TTL in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 2nd June 2005, 05:22

Members who have read this thread : 10

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