Semaphore lock & unlock in MC9S12XEP100

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Semaphore lock & unlock in MC9S12XEP100

1,611 Views
maddularajesh
Contributor III

hai,

   Earlier i had used _ssem & _csem instructions for lock & unlock of semaphores in Xgate for 9S12 controller.

Now i want instruction for lock & unlock of semaphores in Xgate for 9S12XEP100 controller.Please suggest.

Iam using freescale code warrior 5.1 as IDE..

what is the maximum PLL O/P frequency for MC9S12XEP100 controller...

Tags (1)
3 Replies

1,347 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hi,

Below you can find discussion on this topic:

Data sharing between S12x and Xgate 

Especially focus on the shared vars.zip.

Maximum Bus frequency for the S12XE can be 50MHz. So, maximum PLL frequency is 100MHz.

Best regards,

Diana

0 Kudos
Reply

1,347 Views
maddularajesh
Contributor III

I defined as follows with MC9S12XEP100 and using main CPU and XGATE.

 

#define SET_SEMPHR_XGATE(sem_id)   while((!_ssem(sem_id))&&(UI_t)(t1msec-Xgsem_timer)<msec1)){};

#define CLR_SEMPHR_XGATE(sem_id)  _csem(sem_id)

 

SET_SEMPHR_XGATE(0) 

CLR_SEMPHR_XGATE(0) 

 

But while compiling with IDE 5.1 it showing as follow warnings

 

warning: C1801 Implicit parameter declaration for '_ssem'

warning: C1801 Implicit parameter declaration for '_csem'

warning: C1420 Result of function call is ignored  (showing at CLR_SEMPHR_XGATE(0) )

 

In example programs also _ssem & _csem are not available.

Please provide solution to eliminate all warnings as soon as possible.

 

Thank you,

Rajesh

0 Kudos
Reply

1,347 Views
dianabatrlova
NXP TechSupport
NXP TechSupport

Hi Rajesh,

The functions __csem(sem_id) and __ssem(sem_id) you did not declare the function prototype before, that's why you see this warnings.

According to reference manual instructions for lock and unlock a semaphore are SSEM and CSEM.

You could use two address modes:

pastedImage_3.png

For the CSEM

In monadic address mode, bits RS[2:0] select the semaphore to be cleared.

For the SSEM

In monadic address mode, bits RS[2:0] select the semaphore to be set.

pastedImage_1.png

Please see the example code above, in the file xgate.cxgate are used instructions SSEM and CSEM.

Best regards,

Diana