cancel
Showing results for 
Search instead for 
Did you mean: 

Timer routine problem

abdulhameed6
Associate II
Posted on May 11, 2006 at 11:28

Timer routine problem

9 REPLIES 9
abdulhameed6
Associate II
Posted on May 05, 2006 at 11:41

Dear

I am using st10f269 with keil compiler version 4 and on-chip flash

I have problem with one of the variable used to increment in the timer routine.

I am using timer 3 for approx. 12 msec delay and within timer routine incrementing a variable (Highlighted). After incrementing that variable upto 7. This should call the serial transmission routine and set other variables after reaching value 7.

But actually what happening is that it is doing all that after value of 2 instead of 7 in actual hardware.

This thing is not happening when I am simulating this in the keil simulator.

What is wrong with these settings?

I have attached the program c file and startup file with this message.

Kindly tell me that Is there any necessary setting is missing.

Thanks and best regards

Hello

________________

Attachments :

email.txt : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0Ex&d=%2Fa%2F0X0000000bXV%2FFdtJJk.qGj1EFMMPwxDyTj_kpsQ3mzIOH7EaaKBiUeg&asPdf=false

Start16a.a66 : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I0Ir&d=%2Fa%2F0X0000000bXW%2F.6XI40Ngv_5GY_JDK1NKLF8tCIzRV2ctr57MqefAScM&asPdf=false
abdulhameed6
Associate II
Posted on May 09, 2006 at 10:58

dear i have removed this problem by disabling on-chip xram1 and xram2. kinldy tell me what was wrong with this.

Hello.

najoua
Associate II
Posted on May 09, 2006 at 13:31

Hi Hello,

Could you please tell me where is allocated ''uiSerialTx'' variable?

Could you please define it as idata or sdata keeping XRAM1 and XRAM2 enabled? What is the result in this case? Do you observe the same behaviour?

Just a remark: In your start up file, XRAM1 and XRAM2 are already disabled because $SET (INIT_XPERCON = 0 ). The value V_XPERCON is taken into account when $SET (INIT_XPERCON = 1 ).

Best regards,

Najoua.

[ This message was edited by: Najoua on 10-05-2006 11:32 ]

abdulhameed6
Associate II
Posted on May 10, 2006 at 11:10

dear

uiSerialTx located in Ndata0 at address of 0x0F616 according to new map file in which program is running

Best regards

Hello

najoua
Associate II
Posted on May 10, 2006 at 11:29

Hello,

Could you please tell me where is allocated ''uiSerialTx'' variable according to the old map file in which program is not running?

Regards,

Najoua.

abdulhameed6
Associate II
Posted on May 10, 2006 at 11:54

dear

uiSerialTx is located at Ndata0 at 0x0c016 with xram1 and xram2 enabled.

Hello

najoua
Associate II
Posted on May 10, 2006 at 12:22

Hi Hello,

0xC016 address is in the XRAM2 memory.

Are you sure that XRAM2 memory is enabled correctly? As i said in my reply above, in your start up file, $SET (INIT_XPERCON = 0 )so XPERCON = 0x000C may not be taken into account.

An other point: to accede without pbs XRAM1 and XRAM2 memories, the two options ''Use on chip CAN + XRAM(C000-DFFF)'' & ''Use on chip XRAM (E000-E7FF)'' must be enabled under Options for Target--> Target.

If XRAM(1&2) are not configured correctly, the variables have random values when they are located there.

Now, in order to enable correctly XRAM(1 & 2) memories, could you please:

1/ Check your start up file

2/ Enable the two options ''Use on chip CAN + XRAM(C000-DFFF)'' & ''Use on chip XRAM (E000-E7FF)'' must be enabled under Options for Target--> Target.

and tell me if the variable behaves normally or no?

Best regards,

Najoua.

abdulhameed6
Associate II
Posted on May 11, 2006 at 10:13

Dear

i kept check the option in target enable xram1 and xram2.now i will also keep enable these values in startup file and will check the result.

is these option should be same/necessory to set both in keil ide and startup file?

Hello

najoua
Associate II
Posted on May 11, 2006 at 11:28

Hi Hello,

If my suggestion didn't solve the problem:

As i said, I suspect XRAM(1&2) are not enabled correctly.

The key to this can be the monitor configuration. Some of the configuration registers are read-only after the EINIT instruction is executed. Ususally, the startup code of your application executes EINIT but since the monitor runs on the target system before your application, the monitor already executes EINIT. Therefore the monitor configuration (XPEN, XRAM1EN, XRAM2EN etc.) must be correct for your application. This is done in the ''config.inc'' and ''inst167.a66'' files. The monitor is generated with the uVison project which is the monitor project.

Just start the Monitor.uv2 project, select the target (I guess you use 'Bootstrap') and press the 'Rebuild all target files' button in the toolbar.

I hope i was clear.

Regards,

Najoua.