Announcement

Collapse
No announcement yet.

16F19195 compiler defaults when setting ANSELH

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 16F19195 compiler defaults when setting ANSELH

    When attempting to program a 16F19195 the compiler fails to accept ANSELH = $00. PORTH is a 4 bit port RH0-RH3 that does have an ANSELH register. Strange thing is there is no ANSELC register and when I included it the compiler accepts this as if there is one. PORTC is a totally digital port with this chip. My goal was to drive the DB4- DB7 pins of a LCD with RH0-RH3. I have moved the LCD data pins to RA0-RA3 to bypass for now. Is this a bug or a mistake by me?

  • #2
    while waiting for a proper reply from charles try

    in PIC16F19195.PBPINC adding a anselh entry same way as for anselc , PIC16F19195.PBPINC is in devices directory of pbp3 . the bogus anselc won't hurt things

    eg
    ANSELH VAR BYTE EXT ; BANK62

    Comment


    • #3
      Thanks , I added your code and it did "green up" and compile. I haven't moved the wires back yet to see results. I did find that in the listing file(LST) the ANSELH is missing? All the rest of the ANSEL's are there?

      Comment


      • #4
        I looked at the p16f19195.inc file in the MPASMX folder of version 5.20 of MPLABX and there's no ANSELH register defined in that file either. There is however a ANSELC defines at 0x1F4E which is in agreement with the memory map in the datasheet for the 16F19195 but there's no other mention of any ANSELC register in the datasheet.

        What's the last version of MPASMX that will work with PBP, is it 5.35? Perhaps worth a try upgrading or manually edit the p16f19195.inc file to included the ANSELH register. Adding
        Code:
        ANSELH   EQU  H'1E66'
        in the Bank60 section of the file is what I would try in that case. Not that the placement of the line matters much but Bank60 is where it belongs according to the memory map.

        Comment


        • #5
          Thank all for the reply's. I am using MPLABX V.5.35 with MPASM 5.87. Since this upgrade to the 64 pin 19195 has given me more ports for discrete use I am not starved for I/O. Rather than changing asm. files I can wait for MeLabs or Microchip to resolve the ANSELH issue.

          Comment


          • #6
            There aren't going to be any more updates to MPASM, so fixing the .Inc file is your best bet

            Comment


            • #7
              I believe what you are saying is the days of PBP are waning in it's present form. From what I have read all the $$ is being put into XC8, 16, 32 (with it's own assembler). I believe Melabs will have shift to a C compiler and bring on the 16 bit chips to survive. It's been a very good product and blast to use. Cheers

              Comment


              • #8
                PBP is not a Microchip product, it is an independent, albeit approved 3rd party vendor product. Microchip doesn't invest any money in the development or maintenance of PBP. Charles Leo is the person that keeps PBP going.
                We can crack this cotton PIC'n thang!

                Comment


                • #9
                  For the record, I attempted to enter ANSELH EQU H'1E66' into bank 60 from Note Pad and the final result was it's protected. No admin rights allowed so I wasn't allowed to save. Richards PBP work around using a ext. variable does compile. I still need to rewire to prove.

                  Comment


                  • #10
                    my solution is probably only half way, i never expected the mpasm include file for the chip to incorrect also

                    as henrik points out p16f19195.inc will need to fixed too

                    Note Pad and the final result was it's protected. No admin rights allowed
                    you will to give yourself admin permission

                    Comment


                    • #11
                      I have verified that the Microchip include file omits ANSELH. Since my system extracts the SFR names from Microchip's files and the data they publish, PBP also omits the name. I see ANSELH in the datasheet in the PORTH I/O section, but it is omitted from the register summary section 38.

                      I'll need to do some digging to make sure, but I'm guessing the fix in PBP will look something like this:

                      Code:
                      ANSELH VAR BYTE EXT
                      #HEADER
                             ANSELH EQU H'1E66'
                      #ENDHEADER
                      You can insert this in your source program or in the PIC16F19195.PBPINC file for the device. If in the source, an error will occur after you update to a version of PBP with the fix. If in the PBPINC, the file will be replaced by future updates and no error will occur.

                      To edit the .PBPINC files in the Program Files (x86) tree, you'll need to open the editor (Notepad, MCSX) As Administrator, then open the file. The editor will be able to save the file if has admin privileges. Another option is to save the modified PBPINC to the source code folder in your project. This will cause PBP to always use the modified file and ignore new versions written to the PBP folder.
                      Charles Leo
                      ME Labs, Inc.
                      http://melabs.com

                      Comment


                      • #12
                        Thanks to all for your help, I am digesting the info given and will try it.

                        Comment


                        • #13
                          Looking for the same issue. Bumped into your thread. Thanks for creating it. Looking forward for solution. MyBalanceNow
                          Last edited by James7688; 11-21-2021, 07:55 PM.

                          Comment


                          • #14
                            It seems like Microchip and Melabs were caught by surprise by this discovery. I have posted a similar thread on the Microchip's ASM forums site. Still waiting for a response. I have tried the asm. code suggestions from Richard and Leo but I couldn't get it to run. I don't have a extensive experience with assemlby and linking files to make this happen. Interesting thing is how did Microchip let millions of chips make it to market with such a basic set of files left out to control this four bit PORT?

                            Comment

                            Working...
                            X