Processor Expert: can't enable Chip Selects in SynchroMaster bean

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

Processor Expert: can't enable Chip Selects in SynchroMaster bean

2,799 次查看
ZiglioNZ
Contributor I
Hi,

CodeWarrior: 7.1
CPU: MCF54452

I have a number of peripherals on the SPI port and I'm trying to control them via SynchroMaster beans.

Though I get an error when I try to enable any Slave select pin with Output direction.
The error is "This setting is not supported".

But I'm pretty sure there's hardware support within our CPU for hardware chip select.
In fact there are 5 chip select lines.

As a result of this error, the PAR_DSPI register doesn't set any of the DSPI lines to chip select.


I've got also another question.
The SM1_SendChar() function takes an 8 bit unsigned values and writes it to register DSPI_PUSHR.
That register though is a 32 bit one and the upper 16 bits contain information such as the chip select line.
In the generated code, the upper 24 bits appear to be always 0, since a straight copy is done from the 8-bit input value to the 32-bit register.
Therefore, I wouldn't expect to see any chip select line being controlled when a byte is written to SPI.
How could that work?

Thanks!
Emanuele


Message Edited by ZiglioNZ on 2008-10-29 03:15 AM

Message Edited by ZiglioNZ on 2008-10-29 03:39 AM
标签 (1)
标记 (1)
0 项奖励
回复
4 回复数

797 次查看
ProcessorExpert
Senior Contributor III
Processor Expert (PE) is Rapid Application Development environment for embedded systems. High-level beans (as SynchroMaster) are set of  components with unified a cross platform interface and  functionality provided on all supported platforms. This brings, in some cases like this, limitations because it doens't allow to use all features of the hardware platform.

So, if you need to use all features of DSPI module I think the better way will be using a peripheral initialization bean (Init_DSPI) instead of SynchroMaster bean. Init_DSPI generates only initialization code and you can write the code completely yourself.

The second option is to modify the generated code through the "Don´t Write Generated Bean Modules" option for individual beans or "Freeze generated code" option for whole project, both intended for the experienced programmers. They allow to extend or modify code manually, of course without any further warranty on code functionality and without a possibility to re-generate code after a change of bean settings. Please see the Processor Expert help chapter Application design / Code generation and usage / User changes in generated code.

We try to improve the documentation of "Slave select pin" property in the next release of Processor Expert.

best regards
Vojtech Filip
Processor Expert Support Team
UNIS


Message Edited by ProcessorExpert on 2008-10-30 12:47 PM

Message Edited by ProcessorExpert on 2008-10-30 12:47 PM
0 项奖励
回复

797 次查看
ZiglioNZ
Contributor I
Hi,

thank you for your reply.

The DSPI peripheral initialization bean definitely works but I wanted to leverage as much code as possible on the high level device driver SynchroMaster.

How would you handle different peripherals on SPI with SynchroMaster?

Originally I thought I could instantiate that bean multiple times (with different SPI mode and baud rate settings) and then click on "share pin" for Clock, Data Input and Data Output.

But it turns out I'm not allowed to do that because all instances use the same channel (peripheral name) and that's not possible.

How was SynchroMaster meant to be used with multiple peripherals?
0 项奖励
回复

797 次查看
ProcessorExpert
Senior Contributor III
MCF54452 contains only one DSPI peripheral and it can be allocated only by one bean - either Init_DSPI or Synchromaster bean.

Generaly if you are using Synchromaster bean and you need to toggle with slave select pin (the synchromaster bean does not support such functionality directly) you must use additional BitIO bean. To toggle with the slave select, it is possible to use SetVal, ClrVal or NegVal methods of BitIO bean.

If you need to communicate with multiple devices with different baude rates. There is a possibility to use the SetBaudeRateMode method in Synchromaster bean. More information including using this method you find in the help (pop-up menu) of this method.

However, if you need to change the SPI mode at run-time (CONT bit in the DSPI_PUSHR register) you must use the Init_DSPI or make some tweaks with the Synchromaster bean. This is not provided by the SynchroMaster bean. As it has been commented within last reponse, such hardware specific features are not covered by the high-level bean set.

best regards
Vojtech Filip
Processor Expert Support Team
UNIS

0 项奖励
回复

797 次查看
ZiglioNZ
Contributor I
Thank you Filip for your detailed reply, the support provided by the initialization bean is quite good.

Can I ask you also if  there are plans to port additional high level beans to the latest Coldfire mcus?
Is Processor Expert going to be integrated in Codewarrior once the port to Eclipse is complete?

Please let me know if I should put those questions in a new thread.

Thank you
0 项奖励
回复