 |
 |
| View previous topic :: View next topic |
| Author |
Message |
viki2000
Joined: 08 May 2013 Posts: 233
|
|
Posted: Mon Jun 03, 2013 7:01 am |
|
|
...hair I still have, but started to turn into gray color...
'because for Debug mode regarding PIC10F320 is the only option that I have. '
Are you saying you haven't compiled in 'release' mode, burned a PIC, and tried it? You MUST recompile when switching from 'debug' to 'release'.
No, I always compile correctly, switching to release.
When I said "because for Debug mode regarding PIC10F320 is the only option that I have" I meant I need to use Debug mode in future when the code will come more complex and MPLAB is the only (affordable) option that I have for Debugging using header debugger that I bought for PIC10F320.
Inside to MPLAB, in Debug mode, I can use HITECH, XC8 or ASM, no CCS. I already tried that with success.
For the normal testing/compiling/burning I use always Release. No problem here.
I would be very interested to get some answer to my last questions regarding CCS compiler.
I am seriously thinking to use PIC10F322 during my next weeks tests (as I found it without bugs) and only in the end to switch back to PIC10F320. |
|
 |
temtronic
Joined: 01 Jul 2010 Posts: 9658 Location: Greensville,Ontario
|
|
Posted: Mon Jun 03, 2013 7:55 am |
|
|
just to clarify...as english is 'funny' sometimes..
you select 'release' mode first, then compile, correct ?
if so then...
...only thing I can add is to call CCS directly, ask them.
on the surface I can't see what's 'special' about your PIC and I hate to think of the time spent on it....sigh...
I've always had good tech support from CCS especially on the phone. Perhaps someone there can test/debug the problem. I don't have any 10F series PICs here..
From a cost vs time perspective, is there another pin2pin PIC that would be suitable to get the job done? R&D time is $$$, PICs are cheap.
When a solution is found, please, post the answer! Some of us oldtimers would like to know!!
jay |
|
 |
viki2000
Joined: 08 May 2013 Posts: 233
|
|
Posted: Mon Jun 03, 2013 8:05 am |
|
|
just to clarify...as english is 'funny' sometimes..
you select 'release' mode first, then compile, correct ?
Correct. There is no problem with that, just look at the experiments below.
Last edited by viki2000 on Mon Jun 03, 2013 8:14 am; edited 3 times in total |
|
 |
viki2000
Joined: 08 May 2013 Posts: 233
|
|
Posted: Mon Jun 03, 2013 8:07 am |
|
|
I just made a series of tests which bring us close to the root of the problem.
I downloaded the latest demo version of CCS IDE compiler and I used it for 2 chips PIC10F320 and PIC10F322 in 2 ways:
- One time I wrote and compiled the simple blinking code inside the CCS IDE and the hex file result was burned using Pickit3 hardware programmer also in 2 ways: using the MPLAB IPE and another time using Pickit3 application from Pickit3 Scripting 3.00 beta.
- One time I wrote the code inside to MPLABX, compiled and burned inside to MPLABX.
There are many combinations done and the result is always the same: PIC10F322 works all the time without problem and PIC10F320 does not.
All the tests with PIC10F322 are not relevant for PIC10F320.
To remember, that on the same hardware, with the same chip PIC10F320, there is no problem with HITECH, XC8 “corrected” regarding RAMBANK.
The above tests indicate for me that also CCS C compiler followed the same wrong info from PIC10F320 datasheet.
I would like to know where are the settings for PIC10F320 regarding RAMBANK in CCS C compiler.
Any ideas? Could they be found/modified as I have done for HITECH, XC8? Or are hidden?
Last question that may arrive from your side:
- How come stinky had good results with PIC10F320?
I have in my mind only 3 possible answers:
1)PIC10F320 revision A1 or A2? http://ww1.microchip.com/downloads/en/DeviceDoc/80529C.pdf
When I connect Pickit3 inside to MPLAB I see “Device ID Revision = 1” and I guess is A1. I have no other idea where to look for A1, A2. Maybe stinky has A2.
2)Maybe command line compiler has not the same bug as CCS IDE compiler
3) Maybe your version of compiler has no bug and mine has, meaning wrong RAMBANK reference.
The present problem was reported today to Microchip with Customer ticket number and hopefully they change that datasheet and their HITECH, XC8 compiler.
For CCS C, I let you guys report it to CCS.
I just go with PIC10F322 for the moment. |
|
 |
viki2000
Joined: 08 May 2013 Posts: 233
|
|
Posted: Tue Jun 04, 2013 1:12 am |
|
|
Just for your information:
- I have minimum 20 pieces of PIC10F320 on my desk and I changed them sometimes for test purpose. All behave the same. In MPLABX, with Pickit3 they could be identified as (Device ID Revision 1, Device ID:29a0), meaning revision A1 according with http://ww1.microchip.com/downloads/en/DeviceDoc/80529C.pdf
- I found on Softpedia the PCWHD version4.136, limited version of course. I tried it and has the same "bad" behavior towards PIC10F320 revision A1. You may try it too: http://www.softpedia.com/progDownload/PCWHD-Compiler-Download-221913.html
How stinky succeed with PIC10F320 is something that will be nice to be known. |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 20161
|
|
Posted: Tue Jun 04, 2013 2:09 am |
|
|
As a comment, I'm not sure the memory problem you mention actually exists.
On a debug version of the chip here, it merrily reads and writes address 0x40....
The original code you posted also works on this.
Now it is very interesting about RevA1/RevA2. If you look at the errata sheet, it tells you how the byte identifies A1/A2, and 'yes', '1' implies A1. However every listed erratum, applies to both A1, and A2!. I'm wondering if A1, was an engineering release, with a major memory problem, and was never meant to be distributed, and somehow you have got these!.
You can 'prove' whether this is the problem by simply adding to the head of your program (above the main), the lines:
| Code: |
int16 filler[16];
#byte filler=0x40
|
This reserves the area from address 0x40 to 0x5F, and the compiler won't then use these addresses.
The device database can be edited if you have the IDE, but not with the command line compiler.
There is only 'one' CCS compiler for any particular version. The IDE is an environment that sits on top of the compiler, and uses the command line compiler to actually do the compilation.
Interestingly the default behaviour of the compiler is to put it's scratch at 0x60. Normally the bottom of memory is used for the scratch. It does suggest that at some point there was a version of the chip which did not have working memory below this point, but they were then told they could use the memory beneath this.
I've had experience of chips 'escaping' that were not meant to be supplied, and I wonder if this is what has happened here....
A quick search of the MPLAB forums finds:
<http://www.microchip.com/forums/m654174-print.aspx>
Look at the comment by mad_c from Sunday May 27th. Rev A1, was the internal engineering release, and was not meant to be shipped....
Somehow you have got a batch of faulty chips. Moan to your supplier and have them replaced.
Best Wishes |
|
 |
viki2000
Joined: 08 May 2013 Posts: 233
|
|
Posted: Tue Jun 04, 2013 2:32 am |
|
|
I started to believe that thing with Revision A1/A2 and make sense.
I tried your suggestion with:
int16 filler[16];
#byte filler=0x40
but without success...is not working. |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 20161
|
|
Posted: Tue Jun 04, 2013 2:59 am |
|
|
| viki2000 wrote: | I started to believe that thing with Revision A1/A2 and make sense.
I tried your suggestion with:
int16 filler[16];
#byte filler=0x40
but without success...is not working. |
OK. Try after the #device in your include file:
#RESERVE 0x40:0x5F
The filler won't force some things to be relocated, this instead will just set the memory to be totally 'reserved', but has to be the top instruction after #device.
Best Wishes |
|
 |
viki2000
Joined: 08 May 2013 Posts: 233
|
|
Posted: Tue Jun 04, 2013 3:16 am |
|
|
Evrika! This time worked.
#RESERVE 0x40:0x5F is a good solution for the moment.
I did not include the "filler" solution proposed first time.
I included only the RESERVE.
For me make sense now.
stinky has A2, but with Pickit2 he cannot check that, I guess.
I, with Pickit3, was able to see that I have A1... with problems.
So finally seems what you found on Microchip website: PIC10F320 chips Revision A1, engineering chips, supposed to not be sold accompanied by the datasheet released later for A2 Revision....
And here is the problem: when you buy PIC10F320, in small quantities, how can the seller/distributor know if is A1 or A2. It does not know...unless you buy from Microchip directly, you know the issue and you ask prior buying...
What can I say, lucky me, in 2-3 weeks, almost like a beginner, I was confronted with 2 bugs regarding the software (CCS plugin MPLABX for PIC10F320) and now hardware, revisions for the same chip...
I decided to send an email also to CCS technical support in which a link to the present topic was included.
Thank you very much for all your help, especially in "demystifying" the success behind stinky's good result test. |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 20161
|
|
Posted: Tue Jun 04, 2013 4:04 am |
|
|
Seriously, A1, was not mean to ever be sold.
A supplier should be able to verify what version chips are (every one I deal with can - version checking is _required_ for many jobs).
I asked two of my suppliers, and they stated that A1, was only ever supplied as engineering samples. They has received a few when the chip first came out, and were asked to return them all.
I'd suspect your supplier has been selling these....
Hmmm.
No wonder no-one else could reproduce your problem.
Best Wishes |
|
 |
temtronic
Joined: 01 Jul 2010 Posts: 9658 Location: Greensville,Ontario
|
|
Posted: Tue Jun 04, 2013 5:18 am |
|
|
arrrrrrrrrgh ! man I'd be totally bald over this PIC problem !!
I'm super happy it's been solved (hate to think of the total man hours involved though!)
Perhaps contact Microchip directly(include a link to this post),seems they owe you a hundred PIC or so. They've been generous with me in the past when 'issues' came up.
cheers
jay |
|
 |
FvM
Joined: 27 Aug 2008 Posts: 2337 Location: Germany
|
|
Posted: Tue Jun 04, 2013 5:20 am |
|
|
I have no comments to the rev. A1 issue, just two questions
- you say you have a 10F320 debug header. What's the part number, I couldn't locate it at microchip.com.
- you stated MPLAB debug doesn't work with CCS compiler. Are you sure? I'm using it since ever for PIC12/16/18/24. |
|
 |
Ttelmah
Joined: 11 Mar 2010 Posts: 20161
|
|
Posted: Tue Jun 04, 2013 6:04 am |
|
|
The one I have is AC244045, but it comes with a special chip with extra legs.
Best Wishes |
|
 |
viki2000
Joined: 08 May 2013 Posts: 233
|
|
Posted: Tue Jun 04, 2013 7:24 am |
|
|
The header debugger for PIC10F320 is this one:
http://www.microchipdirect.com/ProductSearch.aspx?keywords=AC244045
I bought it last week and I used it also today. Works only in MPLAB, MPLABX with program written in ASM or HITECH or XC8.
I received today ICD-U64 programmer and works inside the CCS IDE only to burn PIC10F320. You cannot debug with it.
Seems that regarding PIC10F320/322 debugging I am stuck with MPLAB and HITECH compiler using the above header debugger.
I also bought next development board:
http://www.microchipdirect.com/ProductSearch.aspx?keywords=AC103011
and has PIC10F322 on it. I just received it today.
In my previous tests I used a breadboard.
Few weeks ago I bought also entire range of small PIC10F, from 200 up to 322. I have also for some 2 version of packaging.
In my previous tests I used always SOT23-6.
When I have time I will try also DIL-8 package and also "L" version of the 10F320. I will update when I can. |
|
 |
viki2000
Joined: 08 May 2013 Posts: 233
|
|
Posted: Tue Jun 04, 2013 8:46 am |
|
|
A short update:
- I made tests with DIP package of PIC10F320, which was detected by MPLAB and Pickit3 with the same A1 revision.
- Then I made tests also with DIP package of PIC10LF320, which was detected by MPLAB and Pickit3 also with the same A1 revision.
I can confirm that both F320 and LF320 have the same problems as above and the same solutions as above, meaning in HITECH and XC8 picc.ini has to be changed RAMBANK and for CCS compiler to skip that part of RAM with RESERVE. |
|
 |
|
|
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
|