"SPIx_Init_Advanced" for Stellaris M3, MikroPascal

General discussion on mikroPascal PRO for ARM.
Post Reply
Author
Message
Orionsem
Posts: 14
Joined: 12 Nov 2009 17:07

"SPIx_Init_Advanced" for Stellaris M3, MikroPascal

#1 Post by Orionsem » 26 Nov 2015 11:08

Hi everybody,
I am using a Mikromedia M3 ARM board with a TI Stellaris LM3S9B95. But when I initialize module SPI0 connected to port bits PA2, PA4, PA5, the board locks up, using this command:

-> SPI0_Init_Advanced(400000, _SPI_MASTER, _SPI_16_BIT OR _SPI_CLK_IDLE_HIGH, _SPI_FIRST_CLK_EDGE_TRANSITION);

when I initialize using SPI0_Init, the board works normally.

I need to use the Advanced mode because I have 14 bits DACs connected to this SPI.

Can anybody help me please? thank you in advance!

Jean Louis

User avatar
aleksa.jovanovic
Posts: 526
Joined: 30 Jun 2015 08:48

Re: "SPIx_Init_Advanced" for Stellaris M3, MikroPascal

#2 Post by aleksa.jovanovic » 27 Nov 2015 14:21

Please try this and see if it works, it worked for me

Code: Select all

void main() {
 
 SPI0_Init_Advanced(2000000, _SPI_MASTER, _SPI_8_BIT | _SPI_CLK_IDLE_HIGH, &_GPIO_MODULE_SPI0_A245);
 
 while(1){
 SPI0_write(0x0F);
          }
 }
Best regards,
Aleksa

Orionsem
Posts: 14
Joined: 12 Nov 2009 17:07

Re: "SPIx_Init_Advanced" for Stellaris M3, MikroPascal

#3 Post by Orionsem » 27 Nov 2015 14:35

Hi Aleksa,

thanks for your reply and hint. I will give it a try soon.

best regards,

Jean Louis

User avatar
aleksa.jovanovic
Posts: 526
Joined: 30 Jun 2015 08:48

Re: "SPIx_Init_Advanced" for Stellaris M3, MikroPascal

#4 Post by aleksa.jovanovic » 30 Nov 2015 14:34

Please let me know if it works.

Best regards
Aleksa

Post Reply

Return to “mikroPascal PRO for ARM General”