Modifying (data) register (of one output-port) from XGATE and S12X

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Modifying (data) register (of one output-port) from XGATE and S12X

1,754 次查看
svenny29
Contributor I
Hi!!

If one register (i.e. Port T data register) is modified in S12X and XGATE code and theoretically this could be done simultaneously, do I have to use a semaphore for this problem?

Let's assume, that I modify 20 register from XGATE and S12X-core, how can I realise this with only 8 semaphores?

Can somebody help me?

The background:

XGATE code is clearing one output pin of port T. With an oscilloscope I can see that this is working, but only after 56ns (which is faster than the XGATE-cycle, which is around 200ns in my system) this pin gets set again. So, who the **** is setting the output pin again? I guess it is the S12X!?

Thanks for your help!
标签 (1)
0 项奖励
回复
1 回复

752 次查看
Steve
NXP Employee
NXP Employee
The Port T bit could be set by either XGATE (not possible in your system), the CPU (does it write to that port?) or maybe by the timer (depending on how the system is configured).
The simplest approach for a dual-core system is to have them share access to as few common resurces as possible. This means that you don't have one waiting while the other performs its operation and in turn makes your system faster and more efficient.
If you do have to share resources then there are various approaches - have a look at the app note AN2685.
I suggest you find out what is setting the bit first then decide if you can avoid this operation by moving the function to another port or by reassigning it to XGATE and if not then look at the ideas for sharing the port (including semaphores).
Don't forget that either core can cause an interrupt on the other and this can be used to force actions in response to system needs.
0 项奖励
回复