It is currently 19 Oct 2017 01:39

All times are UTC + 1 hour




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: 14 Jun 2017 22:34 
Offline

Joined: 12 May 2007 14:04
Posts: 93
Location: Italy
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 ... :?

_________________
Easy PIC v7 - Easy PIC Fusion V7 - Visual TFT - Visual GLCD - Mikrobasic PRO for PIC - mikroBasic PRO for dsPIC - Mikrobasic PRO for PIC32 - MikroMedia PIC18FJ - MikroMedia PIC32 - Workstation V7
http://www.teolab.it


Top
 Profile  
 
PostPosted: 15 Jun 2017 17:10 
Offline
User avatar

Joined: 21 Mar 2017 16:57
Posts: 519
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


Top
 Profile  
 
PostPosted: 17 Jun 2017 13:41 
Offline

Joined: 12 May 2007 14:04
Posts: 93
Location: Italy
Solved! Thank you very very much! :D

_________________
Easy PIC v7 - Easy PIC Fusion V7 - Visual TFT - Visual GLCD - Mikrobasic PRO for PIC - mikroBasic PRO for dsPIC - Mikrobasic PRO for PIC32 - MikroMedia PIC18FJ - MikroMedia PIC32 - Workstation V7
http://www.teolab.it


Top
 Profile  
 
PostPosted: 29 Jun 2017 00:14 
Offline
User avatar

Joined: 21 Mar 2017 16:57
Posts: 519
You're welcome

Best regards


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: