|
|
View previous topic :: View next topic |
Author |
Message |
bschriek
Joined: 18 Dec 2007 Posts: 80
|
Cannot switch-off Power UP Timer (PUT) at 12F675 |
Posted: Mon Mar 23, 2009 2:30 am |
|
|
Code starts with:
#include <12F675.H>
#FUSES INTRC_IO,NOMCLR,NOCPD,NOWDT,BROWNOUT,NOPUT
etc.....
The Power Up Timer (PUT) is always enabled.
PUT or NOPUT command, both result in an enabled Power Up Timer.
Is there a way to switch-off the PUT in the program code at an other way
than setting the fuses?
Now every time the Power Up Timer must be disabled in the menu of the programmer by hand.
IDE, PCB and PCM version 4.060 |
|
|
Ttelmah Guest
|
|
Posted: Mon Mar 23, 2009 3:31 am |
|
|
What programmer?.
If you look at the .lst file, the PUT fuse, _is_ being changed by the compiler. It suggests your prgrammer is overriding the value.
Compiling two programs, one with PUT enabled, and one without, gives in the hex file:
:02400E00F5318A //Without PUT
:02400E00E5319A //With PUT
Note the 'E', rather than 'F', which is correctly clearing bit 4 of the config register.
Best Wishes |
|
|
bschriek
Joined: 18 Dec 2007 Posts: 80
|
|
Posted: Mon Mar 23, 2009 4:10 am |
|
|
I have added the C-code and List file.
PUT enabled
C-code:#FUSES INTRC_IO,NOMCLR,NOCPD,NOWDT,NOBROWNOUT,NOPROTECT,PUT
List code:Configuration Fuses:
Word 1: 3184 NOWDT NOCPD NOPROTECT NOMCLR PUT INTRC_IO NOBROWNOUT BANDGAP_HIGH
PUT should be disabled but...
C-code#FUSES INTRC_IO,NOMCLR,NOCPD,NOWDT,NOBROWNOUT,NOPROTECT,NOPUT
List code: Configuration Fuses:
Word 1: 3184 NOWDT NOCPD NOPROTECT NOMCLR PUT INTRC_IO NOBROWNOUT BANDGAP_HIGH
The config word must be 3194 but it isn't????
The programmer is a GALEP-4 with updates but the result is the same at our home made PIC programmer.
We already checked the output file and fuses before.
We can live with it for now but it would be nice if we could overide the #fuses by a C-command.
Is there a way to change the #fuses in C?
A compiler update would be better of course but first we want to be sure it's not a mistake of ours.
Best regards and thank you in advance,
Bas |
|
|
Ttelmah Guest
|
|
Posted: Mon Mar 23, 2009 6:08 am |
|
|
Try reloading the original devices4.dat file that came with the compiler (or re-installing the compiler). This behaviour can be triggered if the device editor has been used, and the fuse is incorrect in the file...
Best Wishes |
|
|
bschriek
Joined: 18 Dec 2007 Posts: 80
|
|
Posted: Mon Mar 23, 2009 7:42 am |
|
|
We checked the fuses in the Device Table Editor and this seems o.k.
The PUT/NOPUT mask and value are o.k.
Furthermore we also installed the C-compiler at an other computer and the result is the same. PUT is always ON.
We already got 2 updates because of bugs in the compiler and therefore I don't want to install the "older" .dat files. The old bugs may come back.
Is there a way to change the #fuses in C???? |
|
|
S9J8Z6 Guest
|
|
Posted: Mon Mar 23, 2009 9:28 am |
|
|
You can include a #ROM statement, with the required byte values to put into the fuse locations.
What puzzles me though, is why your compiler is doing this. The compiled lines I posted, came from the same compiler version, and it works fine....
Best Wishes |
|
|
bschriek
Joined: 18 Dec 2007 Posts: 80
|
|
Posted: Mon Mar 23, 2009 10:08 am |
|
|
We added this code: #ROM 0xF2007={0X3194}
This command does nothing at adress 0x2007.
Other addresses can be changed by the #ROM command but not address 0x2007!
For 0x2007 the settings are used according the #FUSES at the begin of the program. |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Mon Mar 23, 2009 10:25 am |
|
|
Do you have the setting ICD=TRUE in your code?
I know on some chips this setting forces the NOPUT, NOBROWNOUT and NOWDT fuses. I can't test it right now, but maybe your compiler version / chip type forces the PUT fuse? |
|
|
Ttelmah Guest
|
|
Posted: Mon Mar 23, 2009 10:49 am |
|
|
Er.
The address you have selected, is F2007......
I like Ckielstra's idea. Had forgotten about the ICD settings.
Best Wishes |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Mar 23, 2009 11:05 am |
|
|
I installed vs. 4.060 and compiled the following test program:
Code: |
#include <12F675.h>
#device ICD=TRUE
#FUSES INTRC_IO,NOMCLR,NOCPD,NOWDT,BROWNOUT,NOPUT
#use delay(clock=4000000)
//==========================
void main()
{
while(1);
} |
Here's part of the .LST file. It has NOPUT in it::
Quote: | CCS PCM C Compiler, Version 4.060, xxxxx 23-Mar-09 09:28
Filename: 12F675_Test.lst
Configuration Fuses:
Word 1: 3194 NOWDT NOCPD NOPROTECT NOMCLR NOPUT INTRC_IO NOBROWNOUT BANDGAP_HIGH |
0x3194 is in the HEX file. That's the same Config word as in the .LST file:
Quote: | :10000000000000308A000428FF238316900000308F
:100010008A000A2884011F3083051F1383161F10CE
:100020009F101F119F11073083129900162817285F
:02400E009431EB
:00000001FF
;PIC12F675 |
So it works for me. I suggest that you re-install your compiler. |
|
|
bschriek
Joined: 18 Dec 2007 Posts: 80
|
|
Posted: Tue Mar 24, 2009 2:04 am |
|
|
Thank you very much for your help!
ICD=TRUE ----> solved the problem
For now every program starts with this code.
Best regards, |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Tue Mar 24, 2009 3:17 am |
|
|
bschriek wrote: | Thank you very much for your help!
ICD=TRUE ----> solved the problem
For now every program starts with this code. | I would not recommend this. You don't want to supply all your customers with an ICD, just to allow them to run the program...
Somewhere you have a more basic problem in your setup.
What worries me is the conflict between your problem description and the results from PCM Programmer's test. Have you tried to run PCM's test program and do you get the same results?
Do you really have PCB version 4.060? Check the number as reported on top of the *.lst file. |
|
|
bschriek
Joined: 18 Dec 2007 Posts: 80
|
|
Posted: Tue Mar 24, 2009 4:30 am |
|
|
You are right, the program must run without ICD.
In fact, we don't even have an ICD.
For now we only use the ICD=TRUE command to switch-off the PUT.
Now the circuitry and the program runs fine and the PUT is really switched-off.
For your information I have added the program of mr "PCM programmer" and modified some fuses with and without the ICD=TRUE code.
One way or another the compiler forces some fuses without warning.
#include <12F675.h>
#device ICD=TRUE
#FUSES INTRC_IO,NOMCLR,NOCPD,NOWDT,BROWNOUT,NOPUT
#use delay(clock=4000000)
//==========================
void main()
{
while(1);
}
/*
.LST result:
CCS PCM C Compiler, Version 4.060, 37576 24-mrt-09 10:54
C-Code:
#device ICD=TRUE
#FUSES INTRC_IO,NOMCLR,NOCPD,NOWDT,BROWNOUT,NOPUT
.LST result:
Configuration Fuses:
Word 1: 3194 NOWDT NOCPD NOPROTECT NOMCLR NOPUT INTRC_IO NOBROWNOUT BANDGAP_HIGH
C-Code:
//#device ICD=TRUE
#FUSES INTRC_IO,NOMCLR,NOCPD,NOWDT,BROWNOUT,NOPUT
.LST result:
Configuration Fuses:
Word 1: 31D4 NOWDT NOCPD NOPROTECT NOMCLR NOPUT INTRC_IO BROWNOUT BANDGAP_HIGH
C-code:
#device ICD=TRUE
#FUSES INTRC_IO,NOMCLR,NOCPD,NOWDT,NOBROWNOUT,NOPUT
.LST result:
Configuration Fuses:
Word 1: 3194 NOWDT NOCPD NOPROTECT NOMCLR NOPUT INTRC_IO NOBROWNOUT BANDGAP_HIGH
C-code:
//#device ICD=TRUE
#FUSES INTRC_IO,NOMCLR,NOCPD,NOWDT,NOBROWNOUT,NOPUT
.LST result:
Configuration Fuses:
Word 1: 3194 NOWDT NOCPD NOPROTECT NOMCLR NOPUT INTRC_IO NOBROWNOUT BANDGAP_HIGH
C-code:
#device ICD=TRUE
#FUSES INTRC_IO,NOMCLR,NOCPD,NOWDT,BROWNOUT,PUT
.LST result:
Configuration Fuses:
Word 1: 3194 NOWDT NOCPD NOPROTECT NOMCLR NOPUT INTRC_IO NOBROWNOUT BANDGAP_HIGH
C-code:
//#device ICD=TRUE
#FUSES INTRC_IO,NOMCLR,NOCPD,NOWDT,BROWNOUT,PUT
.LST result:
Configuration Fuses:
Word 1: 31C4 NOWDT NOCPD NOPROTECT NOMCLR PUT INTRC_IO BROWNOUT BANDGAP_HIGH
*/ |
|
|
Ttelmah Guest
|
|
Posted: Tue Mar 24, 2009 8:49 am |
|
|
The point that Ckielstra was making, was that _if you did have ICD=TRUE in your code, it would force the PUT off, and therefore explain it not being changeable by your code_.
Both PCM, and myself, have compiled example programs, and PUT changes fine with them, using your compiler version...
Using the #ROM statement _with the right address_, should allow you to override the setting. Why it is not working for your, _must_ be down to something you are doing, either in the setup, or installation. Is it possible (for instance), that in fact the compiler is accessing an incorrect devices4.dat file, because there is another in a directory in your 'path' somewhere?.
Best Wishes |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Mar 24, 2009 11:21 am |
|
|
Quote: |
We already got 2 updates because of bugs in the compiler and therefore
I don't want to install the "older" .dat files. The old bugs may come back. |
This implies that you are using specially prepared ".dat" file updates
from CCS. Sometimes CCS support will email special .dat files to users
to fix a problem. In other words, you are not using the original "pure"
4.060 compiler. This could account for the differences between what we
are seeing and you are seeing. Since we don't have those special files,
we can't duplicate your problem. |
|
|
|
|
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
|