MikroElektronika Forum
https://forum.mikroe.com/

Mikromedia Workstation v7 vs Mikromedia 32: strange behavior
https://forum.mikroe.com/viewtopic.php?f=12&t=70295
Page 1 of 1

Author:  Darklakebridge78 [ 14 Jun 2017 22:34 ]
Post subject:  Mikromedia Workstation v7 vs Mikromedia 32: strange behavior

Hi to all!
I have a problem with my mikromedia workstation v7 and my mikromedia for PIC 32. I state I use Visual TFT and Mikrobasic for PIC32 for compile my firmware. The problem arises when I compile a program that uses the SD card for images and fonts and the Mikromedia for PIC32 board is installed on the workstation. The program, in this situation, does not start. If I remove the board PIC 32 from the workstation and power this with a lithium battery all mysteriously works. Where am I wrong? Is there anything that interferes with the SPI bus? If I write a program that does not use the SD card it all works normally in any situation ... can someone help me? I'm confused ... :?

Author:  darko.ilijevski [ 15 Jun 2017 17:10 ]
Post subject:  Re: Mikromedia Workstation v7 vs Mikromedia 32: strange beha

Hello,

The problem is - when you use the board on the mikromedia, you will have to slow down the "fast SPI mode". You have to search for this line of code:

    ' Reinitialize SPI at higher speed
    SPI2_Init_Advanced(_SPI_MASTER, _SPI_8_BIT, 4, _SPI_SS_DISABLE, _SPI_DATA_SAMPLE_MIDDLE, _SPI_CLK_IDLE_HIGH, _SPI_ACTIVE_2_IDLE)

and replace it with this :
    ' Reinitialize SPI at higher speed
    SPI2_Init_Advanced(_SPI_MASTER, _SPI_8_BIT, 8, _SPI_SS_DISABLE, _SPI_DATA_SAMPLE_MIDDLE, _SPI_CLK_IDLE_HIGH, _SPI_ACTIVE_2_IDLE)

The numbers that are changed ( 4 to 8 ) are SPI baudrate divisors and if you set SPI too fast, it will have problems with the "elongated" conductors - when you plug it in the board, it's lines become a part of the circuitry and can introduce some interferences. It worked for me with the divisor of 8.

Best regards

Author:  Darklakebridge78 [ 17 Jun 2017 13:41 ]
Post subject:  Re: Mikromedia Workstation v7 vs Mikromedia 32: strange beha

Solved! Thank you very very much! :D

Author:  darko.ilijevski [ 29 Jun 2017 00:14 ]
Post subject:  Re: Mikromedia Workstation v7 vs Mikromedia 32: strange beha

You're welcome

Best regards

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/