Jump to content

Recommended Posts

I seem to be getting an extra word output from the v7.05 compiler. I'm using MPLAB v8.84 and here's an excerpt of the LST file showing the errant word at 8009;

 


ORG 0x00008007
8007  FFFC   DW 0xFFFC
8008  DFFF   DW 0xDFFF
8009  FFBF   DW 0xFFBF

 

This shows up in the hex file as well which is preventing me from programming the 12F1822 using PICKIT2.

 

:020000040001F9
:02000E00FCFFF5
:04001000FFDFBFFF50  <---
:00000001FF

 

I've attached my source file.

 

Thanks in advance for any help.

 

Cheerful regards, Mike

12F1822_LCD_Buffer_Experiment.c

Edited by Mike McLaren

Share this post


Link to post
Share on other sites

Hi Mike

 

AFAIK I don't see anything wrong there.

 

:02000E00FCFFF5

Says: 2 data bytes at address offset 0x000E, data is "0xFC 0xFF" from your first DW in little endian format.

Line checksum is 0xF5.

 

:04001000FFDFBFFF50

Says: 4 data bytes at address offset 0x0010, data is "0xFF 0xDF 0xBF 0xFF from your second and third DW in little endian formt.

Line check sum is 0x50.

 

Last line is EOF.

 

 

Just to make sure, I compiled your code in both BoostC 7.05 and BosstC 7.10 and made no difference at all, got the same results you show in your post.

 

 

Googling around for "intel hex 32" found this, among many others.

Short and concise.

http://members.ee.net/brey/hex32.pdf

If it is too short this one has more detail

http://www.interlog....nfo/Hexfrmt.pdf

 

 

Best regards

Jorge

Edited by JorgeF

Share this post


Link to post
Share on other sites

Hi Jorge,

 

The problem is that my PICKIT2 is choking on the extra word at 0x8009 in the HEX file, reporting the following;

 

Warning: Hex File Loaded is larger than device.

 

When I build a 12F1822 assembly language program in MPLAB, the hex file does not include a word for address 0x8009.

Share this post


Link to post
Share on other sites

Hi Mike

 

My MPLAB 8.80 says thar Pickit 2 doesn't support the PIC12F1822, only PicKit3.

Better check the "trafic lights" in the select device window.

 

It might be because the addressing mode for the PIC12F1xxx and PIC16F1xxx (enhanced mid range) is a bit different from their predecessors (...Fxxx).

 

 

 

Best regards

Jorge

Edited by JorgeF

Share this post


Link to post
Share on other sites

Yes, MPLAB 8.84 doesn't support 12F1822 and PICKIT2 directly from within the IDE but the PICKIT2 "stand-alone" programming application does support 12F1822.

 

This error doesn't have anything to do with the PICKIT2. The extra word at 0x8009 is being generated by the BoostC compiler.

Edited by Mike McLaren

Share this post


Link to post
Share on other sites

Hi

 

See what you mean.

I've made some tests, also with Microchip tools, and it looks like a compiler or linker bug.

 

Whatever it is, its afecting also the new BoostC 7.10 RC.

 

 

 

Best regards

Jorge

Share this post


Link to post
Share on other sites

Hi Guys,

 

Use the '&' ampersand to string config options together.

 

 

  #pragma DATA _CONFIG1, _FOSC_INTOSC & _WDTE_OFF & _MCLRE_OFF
  #pragma DATA _CONFIG2, _LVP_OFF

 

Cheers

 

Reynard

Share this post


Link to post
Share on other sites

Ahhh, that was it. I'm embarrassed (lol).

 

Thank you Reynard, and thank you Jorge.

 

Have a great day, Gentlemen.

 

Cheerful regards, Mike

Edited by Mike McLaren

Share this post


Link to post
Share on other sites

Hi

 

Well there are two embarassed. :(

With all the time I spent studying and testing the config pragma because of the differences with PIC16 and PIC18 targets, I should had spotted it.

 

 

After all there was an error on the code.

But, don't you think that should not lead to the compiler/linker generating addresses behiond the maximum address range of the PIC.

IMHO I think that this error should have led to some error message and abort the build process, not to an hex file with invalid addresses.

 

I still think that there is a bug in the toolchain.

 

Bet regards

Jorge

Edited by JorgeF

Share this post


Link to post
Share on other sites

The compiler did what the user asked it to do, create 3 consecutive words starting at address 0x8007.

The fact that the target device has no usable rom there for the third word is neither here nor there.

The user may have had some cunning scheme to cope.

 

If you turn on all warnings the linker actually give you a warning.

Warning: Overlapping user DATA at address:0x00008008

 

The programmer gave the clue to what was wrong.

 

I to have stared at a piece of code with an obvoius error but just could not see it until the penny dropped.

 

Cheers

 

Reynard

Share this post


Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...