SPI component - using Tx FIFO - continuous mode

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

SPI component - using Tx FIFO - continuous mode

跳至解决方案
2,219 次查看
davedanenberg
Contributor II

I need to be a SPI master and send words greater than 16 bits. If I were to write my own driver, I see the PUSHR with Tx FIFO register looks promising. However, I would rather use CodeWarrior's ProcessorExpert (Component Inspector) to create a suitable SPI device drivers. I am wondering if someone has come across this - and if there is a SPI "bean" created that has a SPI driver that supports longer words (I need 24 bit).

I can create a SPI init bean that may be helpful (havent tested it yet) - and of course a regular SPI Master LDD bean. Is there a way for init_SPI and SPIMaster_LDD to play together? (component sharing somehow?) Or am I relegated to cut/pasting/editing my own driver.

标签 (1)
1 解答
1,241 次查看
davedanenberg
Contributor II

Vojtech,


Actually - it is OK - I didnt realize that using the CONT bit in the PUSHR register (as the auto-gen'd code does) would work for me. After looking at the auto-gen'ed code more closely I was hopeful it would just work - I just give the DAC_SPI_PTD_SendBlock API a size argument longer than 1 and using the CONT bit, the CS stay asserted through multiple "character" writes. so if I want my 24 bit word, I just set up the data width for 8bits, and send three bytes. Sorry for the trouble,

在原帖中查看解决方案

0 项奖励
回复
2 回复数
1,241 次查看
vfilip
NXP Employee
NXP Employee

Hello,

could you please provide more details about your use-case including targeting MCU and details regarding slave device? However generally you cannot share/use Init_SPI and SPIMaster_LDD component together.

Based on your description, there are the following options:

- use Init_SPI and write the run-time routines manually.

- use SPIMaster_LDD, freeze the generated code and modify it manually.

- use the SPIMaster_LDD and set it to send 8-bit data (handle the SS by GPIO_LDD in case you need to toggle after 24-bits).

Note:

Please post all future PEx related questions on PEx forum: Processor Expert Software

best regards

Vojtech Filip

Processor Expert Support Team

1,242 次查看
davedanenberg
Contributor II

Vojtech,


Actually - it is OK - I didnt realize that using the CONT bit in the PUSHR register (as the auto-gen'd code does) would work for me. After looking at the auto-gen'ed code more closely I was hopeful it would just work - I just give the DAC_SPI_PTD_SendBlock API a size argument longer than 1 and using the CONT bit, the CS stay asserted through multiple "character" writes. so if I want my 24 bit word, I just set up the data width for 8bits, and send three bytes. Sorry for the trouble,

0 项奖励
回复