qɥb
Monolothic Member
- Total Posts : 2094
- Reward points : 0
- Joined: 2017/09/09 05:07:30
- Location: Jupiter
- Status: online
|
Mysil
Super Member
- Total Posts : 2591
- Reward points : 0
- Joined: 2012/07/01 04:19:50
- Location: Norway
- Status: offline
Re: ei() macro not defined for PIC16F153xx devices
2018/04/16 19:44:16
(permalink)
Hi, Is it really meant to be defined? Such a macro is not mentioned in XC8 C Compiler User's Guide. In include file: <htc.h> <pic.h> is included for compatibility when Hi-Tech compiler PICC or PICC-Lite is defined, or if MPLAB C18 compiler is defined. /* MPLAB C18 Compatibility Header */ #ifdef __18CXX #include <pic18.h> #endif Mysil Edit: /* HI-TECH PICC / PICC-Lite compiler */ #if defined(__PICC__) || defined(__PICCLITE__) #include <pic.h> #endif
post edited by Mysil - 2018/04/17 04:10:24
|
qɥb
Monolothic Member
- Total Posts : 2094
- Reward points : 0
- Joined: 2017/09/09 05:07:30
- Location: Jupiter
- Status: online
Re: ei() macro not defined for PIC16F153xx devices
2018/04/16 19:54:23
(permalink)
Mysil ... Such a macro is not mentioned in XC8 C Compiler User's Guide.
Except on pages: 208, 210, 212, and 371...
|
qɥb
Monolothic Member
- Total Posts : 2094
- Reward points : 0
- Joined: 2017/09/09 05:07:30
- Location: Jupiter
- Status: online
Re: ei() macro not defined for PIC16F153xx devices
2018/04/16 20:02:30
(permalink)
Mysil ... In include file: <htc.h> <pic.h> is included for compatibility when Hi-Tech compiler PICC or PICC-Lite is defined, or if MPLAB C18 compiler is defined.
/* MPLAB C18 Compatibility Header */ #ifdef __18CXX #include <pic18.h> #endif You are confusing pic.h and pic18.h
|
qɥb
Monolothic Member
- Total Posts : 2094
- Reward points : 0
- Joined: 2017/09/09 05:07:30
- Location: Jupiter
- Status: online
Re: ei() macro not defined for PIC16F153xx devices
2018/04/16 20:25:57
(permalink)
FYI, I suspect the "_PIC14" / "_PIC14E" / "_PIC14EX" definition is derived from C:\Program Files (x86)\Microchip\xc8\v1.45\dat\picc.ini e.g. the first few lines for the PIC16F15324 section are: [16F15324] ARCH=PIC14EX ... Chips with "PIC14EX" are: 16F15313, 16F15323, 16F15325, 16F15344, 16F15345, 16F15354, 16F15355, 16F15356, 16F15375, 16F15376, 16F15385, 16F15386, 16F18424, 16F18425, 16F18426, 16F18444, 16F18445, 16F18446, 16F18447, 16F18857, 16F18887, 16F19155, 16F19156, 16F19175, 16F19176, 16F19185, 16F19186, 16F19195, 16F19196, 16F19197. The comments at the head of the file only mention PIC12, PIC14 and PIC16, no mention of PIC14E or PIC14EX.
post edited by qɥb - 2018/04/16 20:27:02
|
PStechPaul
Super Member
- Total Posts : 1714
- Reward points : 0
- Joined: 2006/06/27 16:11:32
- Location: Cockeysville, MD, USA
- Status: offline
Re: ei() macro not defined for PIC16F153xx devices
2018/04/16 20:49:38
(permalink)
I have wondered what the numerical code after "PIC" designates. It looks like: PIC10: 6 pin, 8 bit, 12 bit instructions PIC12: 8 pin, 8 bit, 12 bit instructions (some 14 bit) PIC16: 14-18-20-28-40-44 pin, 8 bit, 14 bit instructions PIC17: 40 pin, 8 bit, 16 bit instructions PIC18: 28-40-44 pin, 8 bit, 16 bit instructions In the case of PIC18 and PIC16, the instructions are two less than the number, for PIC12 the number is the instruction width, and for PIC10 the number is two less than the instruction width. I could not find any reference to PIC14, but it may refer to 14 bit instruction processors. I did find the following document (from 20 years ago) on architecture: http://ww1.microchip.com/...n/DeviceDoc/31004a.pdf
post edited by PStechPaul - 2018/04/17 18:07:16
|
qɥb
Monolothic Member
- Total Posts : 2094
- Reward points : 0
- Joined: 2017/09/09 05:07:30
- Location: Jupiter
- Status: online
Re: ei() macro not defined for PIC16F153xx devices
2018/04/16 20:53:38
(permalink)
PStechPaul PIC12: 8-14 pin, 8 bit, 12 bit instructions
There's lots of PIC12 devices with 14 bit instructions. They come in both midrange and enhanced midrange flavours.
|
1and0
Access is Denied
- Total Posts : 7755
- Reward points : 0
- Joined: 2007/05/06 12:03:20
- Location: Harry's Gray Matter
- Status: offline
Re: ei() macro not defined for PIC16F153xx devices
2018/04/16 20:59:04
(permalink)
qɥb FYI, I suspect the "_PIC14" / "_PIC14E" / "_PIC14EX" definition is derived from
If I have to guess, _PIC14 are 14-bit core PIC devices where _PIC14 is the traditional midrange devices, _PIC14E is the enchanced midrange devices such as PIC16Fxxxx (4 digits), and _PIC14EX is such as PIC16Fxxxxx (5 digits). Edit: Refer to Table 5-17: "Predefined Macros" on pages 238-239 of the XC8 User's Guide. _PIC12 - baseline (12-bit instruction) device _PIC12E - enhanced baseline (12-bit instruction) device _PIC14 - mid-range (14-bit instruction) device _PIC14E - Enhanced mid-range (14-bit instruction) device _PIC14EX - extended-bank Enhanced mid-range (14-bit instruction) device _PIC18 - PIC18 (16-bit instruction) device
post edited by 1and0 - 2018/04/16 21:06:22
|
qɥb
Monolothic Member
- Total Posts : 2094
- Reward points : 0
- Joined: 2017/09/09 05:07:30
- Location: Jupiter
- Status: online
Re: ei() macro not defined for PIC16F153xx devices
2018/04/16 21:19:18
(permalink)
1and0 If I have to guess, _PIC14 are 14-bit core PIC devices where _PIC14 is the traditional midrange devices, _PIC14E is the enchanced midrange devices such as PIC16Fxxxx (4 digits), and _PIC14EX is such as PIC16Fxxxxx (5 digits). The PIC16F183xx devices are all PIC14E, not EX, so that rule doesn't work. Edit: Refer to Table 5-17: "Predefined Macros" on pages 238-239 of the XC8 User's Guide. _PIC12 - baseline (12-bit instruction) device _PIC12E - enhanced baseline (12-bit instruction) device _PIC14 - mid-range (14-bit instruction) device _PIC14E - Enhanced mid-range (14-bit instruction) device _PIC14EX - extended-bank Enhanced mid-range (14-bit instruction) device
"Extended bank" seems to mean 64 banks rather than the 32 banks the initial "enhanced" devices had. That means the BSR register has expanded from 5 bits to 6. The datasheets have not been fully updated, in some places they show BSR as 5 bits, and in other places it has 6. Interestingly, the MOVLB instruction is missing bits in the new datasheet in TABLE 36-3 INSTRUCTION SET, but is correctly described (as having a 6 bit constant) later.
|
PStechPaul
Super Member
- Total Posts : 1714
- Reward points : 0
- Joined: 2006/06/27 16:11:32
- Location: Cockeysville, MD, USA
- Status: offline
Re: ei() macro not defined for PIC16F153xx devices
2018/04/16 22:11:30
(permalink)
I edited my post above, noting that all 10F are 6 pin, and all 12F are 8 pin. There are some in the same 12F family that include 16F with 14 or more pins. In the 18F devices, those with letters in the unique device suffixes after the "F" may have more than 40 pins, generally 64, 80, and maybe 100. I think all the designators after the F or C are unique. So you can just specify a "72" or "684" or "1840" or "2550".
|
1and0
Access is Denied
- Total Posts : 7755
- Reward points : 0
- Joined: 2007/05/06 12:03:20
- Location: Harry's Gray Matter
- Status: offline
Re: ei() macro not defined for PIC16F153xx devices
2018/04/16 23:19:41
(permalink)
PStechPaul I edited my post above, noting that all 10F are 6 pin, ...
10F are 6-pin SOT or 8-pin DIP/DFN.
|
PStechPaul
Super Member
- Total Posts : 1714
- Reward points : 0
- Joined: 2006/06/27 16:11:32
- Location: Cockeysville, MD, USA
- Status: offline
Re: ei() macro not defined for PIC16F153xx devices
2018/04/17 02:04:50
(permalink)
Yes, but just six active pins. Similarly, 44 pin packages have the same active pins as the 40 pin DIP, with some N/C pins and perhaps extra Vdd or Vss pins. I'm just trying to figure out the logic of device numbering, and it appears to be somewhat lacking. The PIC17 was a rather unique early device, and more recently there are the PIC24 and PIC30 and PIC32 and PIC33 and the dsPIC varieties. And the very early (1996) PIC14000. I think I bought one way back when I was first considering microcontrollers. I settled on a PIC16C63, IIRC.
|
mlp
boots too small
- Total Posts : 554
- Reward points : 0
- Joined: 2012/09/10 15:12:07
- Location: previously Microchip XC8 team
- Status: offline
Re: ei() macro not defined for PIC16F153xx devices
2018/04/17 10:50:13
(permalink)
qɥb This appears to be an XC8 bug.
Then you should file a support case to report it. That's how it gets onto the "must be fixed" radar.
Mark (this opinion available for hire)
|
qɥb
Monolothic Member
- Total Posts : 2094
- Reward points : 0
- Joined: 2017/09/09 05:07:30
- Location: Jupiter
- Status: online
Re: ei() macro not defined for PIC16F153xx devices
2018/04/17 13:27:34
(permalink)
mark.pappin
qɥb This appears to be an XC8 bug.
Then you should file a support case to report it. That's how it gets onto the "must be fixed" radar.
I'm just an "interested party", it's not my problem, I don't have that PIC. Mark, I would suggest you're a much more qualified person to put in a report with appropriate comments where it could be fixed. ;) (Yes, I know you're ex-Microchip now, but then I've never been an MC employee.)
|
mad_c
Super Member
- Total Posts : 1054
- Reward points : 0
- Joined: 2010/12/12 17:48:27
- Location: Brisbane, Australia
- Status: offline
Re: ei() macro not defined for PIC16F153xx devices
2018/04/17 14:38:54
(permalink)
qɥb Mark, I would suggest you're a much more qualified person to put in a report with appropriate comments where it could be fixed. ;)
Since this is such a clear-cut issue, I have entered a report. However, it is always better for customers to send in a support request. If I create a report and attach a project that I generate, then my reported issue will be fixed and that report will be resolved to my satisfaction. My satisfaction and that of the customer might be very different. Bugs reported by Microchip staff are not bumped up in priority, so there is no advantage there. What is said in these forums often does make its way into reports, but it's important that each report is directly associated with the customer who is affected by the issue and whose voice is resolute. Jeff.
|
ideaman4u
New Member
- Total Posts : 4
- Reward points : 0
- Joined: 2016/11/21 15:12:36
- Location: 0
- Status: offline
Re: ei() macro not defined for PIC16F153xx devices
2018/04/17 14:49:51
(permalink)
LOTS of activity from initial posting. Gratifying to see such interest. Sam
|
Ian.M
Super Member
- Total Posts : 13110
- Reward points : 0
- Joined: 2009/07/23 07:02:40
- Location: UK
- Status: offline
Re: ei() macro not defined for PIC16F153xx devices
2018/04/17 17:49:42
(permalink)
How do you interpret PIC part numbers? (see my reply #4 for the rules of thumb). AFAIK there is no way of determining if a chip is 'Enhanced Baseline' (12 bit core + interrupts) just by its part number code. Also, since I wrote that, the Enhanced Midrange family added five digit part numbers, but still with a leading '1' after the 'F'. @PStechPaul - your datasheet link (in #6 above) is broken (I bet the <expletive> forum mangled it when it did text URL to link). :( Google says its: 4 Section 4. Architecture (DS31004A). Hmm.... that's only chapter four of PICmicro Mid-Range MCU Family Reference Manual (DS33023A) so it certainly doesn't cover baseline and other more exotic families. @All, If you work with 'classic' midrange parts its well worth saving a copy of the full DS33023A. Its equivalent for PIC18 is PIC18C MCU Family Reference Manual (DS39500A) - still 99% applicable to older PIC18F parts.
|
qɥb
Monolothic Member
- Total Posts : 2094
- Reward points : 0
- Joined: 2017/09/09 05:07:30
- Location: Jupiter
- Status: online
Re: ei() macro not defined for PIC16F153xx devices
2018/04/17 18:18:05
(permalink)
Ian.M ... @PStechPaul - your datasheet link (in #6 above) is broken (I bet the <expletive> forum mangled it when it did text URL to link). :(
Works for me. The displayed version is abridged, but the hyperlink itself is intact. The full URL is http://ww1.microchip.com/downloads/en/DeviceDoc/31004a.pdf
|
Ian.M
Super Member
- Total Posts : 13110
- Reward points : 0
- Joined: 2009/07/23 07:02:40
- Location: UK
- Status: offline
Re: ei() macro not defined for PIC16F153xx devices
2018/04/17 18:42:25
(permalink)
I think Paul fixed it about 15 minutes after I posted (from his last edit time), and you tried it about ten minutes later. I',m not going back to edit my post to remove that note to Paul, because the <expletive> forum firewall is certain to barf on all the links . . .
post edited by Ian.M - 2018/04/17 18:43:42
|