|
|
View previous topic :: View next topic |
Author |
Message |
coderchick
Joined: 12 Jun 2008 Posts: 25
|
want to use PIC 16F887 |
Posted: Mon Oct 20, 2008 5:50 pm |
|
|
Hello!
I have a PCWH compiler version 3.245 and would really like to use the 16F887, however, my compiler does not have a *.h for that chip. Does anyone have an idea on if I can make one or where I could get one?
Thanks in advance. _________________ KMoe
~We the willing, led by the unknowing, are doing the impossible for the ungrateful. We have done so much, for so long, with so little. We are now qualified to do anything with nothing -M. Theresa |
|
|
Ttelmah Guest
|
|
Posted: Tue Oct 21, 2008 3:29 am |
|
|
Do a search here on this type of question.
How to do this, has been described here several times.
The .h file, _does not add support for a particular processor to the compiler_. It is the least part of the work.
Since you have the WH compiler, you have device editor, which will allow you to add a chip to the core compiler operation. Copy the .h file for a similar chip, adding or removing the parts for extra peripherals.
The file for the 877A, is a good start (difference is the EUSART, rather than USART, and more ADC inputs).
Biggest changes are in the oscillator setups, and these need to be done in the device editor, not in the .h file.
How hard it'll be, will depend on what extra features you use (MCLR as input etc.).
Best Wishes |
|
|
coderchick
Joined: 12 Jun 2008 Posts: 25
|
|
Posted: Tue Oct 21, 2008 10:39 am |
|
|
Ok, well bummer, I was hoping it'd be a lot easier than that, but thanks, I'll try the search again. _________________ KMoe
~We the willing, led by the unknowing, are doing the impossible for the ungrateful. We have done so much, for so long, with so little. We are now qualified to do anything with nothing -M. Theresa |
|
|
coderchick
Joined: 12 Jun 2008 Posts: 25
|
|
Posted: Tue Oct 21, 2008 1:39 pm |
|
|
Alright, I was given the following link to use my device editor:
http://www.ccsinfo.com/forum/viewtopic.php?t=29362
Here's my problem, the thread is device specific, what I can't figure out is where he found the addresses he used! The Debugger Start Address and Size should be in the device data sheet, but I've been unsuccessful in finding them. Also, where does he find the Hardware Device ID and Hardware Mask? Again I've done searches in the data sheet for device id and mask and have come up fruitless. I understand that you can also ping the chip for this data using the ICD or similar programmer, but I do not have access to this chip yet. Anyone have any ideas?
Also, there are going to be more changes for my migration from the 16F877A to the 16F887, as Ttelmah mentioned, there are more ADC (which are fairly easy) the EUSART and oscillator (which I fear may be more complicated). Again, any help in walking through this would be greatly appreciated. Most of the other stuff I can do on my own, I'm just having a major issue with finding the addresses for my chip.
Help? _________________ KMoe
~We the willing, led by the unknowing, are doing the impossible for the ungrateful. We have done so much, for so long, with so little. We are now qualified to do anything with nothing -M. Theresa |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Oct 21, 2008 1:45 pm |
|
|
Quote: | I'm just having a major issue with finding the addresses for my chip. |
Some of this will be in the Programming Specification for the PIC.
Go to the Microchip Data Sheet Finder page (bookmark this page):
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=2046
Select your PIC in the drop-down box and wait for the page to load.
Then, scroll down that page and find the link for the Programming Spec
on the left side. |
|
|
coderchick
Joined: 12 Jun 2008 Posts: 25
|
|
Posted: Tue Oct 21, 2008 5:39 pm |
|
|
That helped a little bit. I was able to determine the HW Device ID, but the HW Mask, Debugger Start address and Size, and the Reserved ROM start and end I'm still unsure of. I think I can leave the Debugger Start Address, Size, ROM start and ROM end as they are, but again I don't know for certain.
As for the HW Mask, I can't figure that one out to save my life and I'm still worried about the oscillator and EUSART, though I haven't delved much into those ones yet. This is the first time I've done something like this, not to mention that I have a very small idea of what I'm doing, so I would really like to not screw it up. I'm going crazy here, it doesn't seem like it should be this hard, so what dots am I unable to connect here? _________________ KMoe
~We the willing, led by the unknowing, are doing the impossible for the ungrateful. We have done so much, for so long, with so little. We are now qualified to do anything with nothing -M. Theresa |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Oct 21, 2008 6:00 pm |
|
|
I think HW Mask is a mask for the Device ID word. It's purpose is to
mask off the lower bits, which are used for the Silicon Revision number.
Those bits can be different, depending upon which date code you get
when you buy the PIC.
The 16F887 Programming Specification shows the bit layout as follows:
Code: |
Device Dev Rev
PIC16F887 10 0000 100 x xxxx |
Based on looking at the HW Mask for similar PICs, I think it should be:
|
|
|
dbotkin
Joined: 08 Sep 2003 Posts: 197 Location: Omaha NE USA
|
|
Posted: Wed Oct 22, 2008 11:46 am |
|
|
You can use the device editor and build your own .h file. I wasn't too keen on that approach myself. I spend enough time chasing down code bugs, I didn't want to spend more time chasing bugs in how I built the device description.
You could do it the lazy way like I did... buy a year of maintenance and finally upgrade your compiler. I've also had some success in emailing CCS tech support, explaining the problem and asking for their help. They've been really good to work with.
Dale |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|