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?
Announcement
Collapse
No announcement yet.
16F19195 compiler defaults when setting ANSELH
Collapse
X
-
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. AddingCode:ANSELH EQU H'1E66'
Comment
-
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
-
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
-
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
-
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
-
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
Comment
-
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
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.
- 1 like
Comment
-
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
Comment