mikroMMB for PIC24 Help

Post your requests and ideas on the future development of mikroC PRO for dsPIC30/33 and PIC24.
Post Reply
Author
Message
FaCIA
Posts: 1
Joined: 01 Jul 2011 11:24

mikroMMB for PIC24 Help

#1 Post by FaCIA » 01 Jul 2011 11:41

hi,
that I found on the serial flash memory, the new PIC24 mikroMMB entered the value of the type of reading on screen, I need a sample. please help me?

I can not run the following code? What's wrong?

//--------------------- Serial Flash M25P80 ---------------------//
#include <built_in.h>
#include "Serial_Flash_driver.h"
sbit CS_Serial_Flash_bit at LATC2_bit;
sbit CS_Serial_Flash_Direction_bit at TRISC2_bit;

unsigned int S_Bil=325, S_Bil_A=1123;
unsigned short H_Bil=55;
extern void SetIntroScreen();

void main() {

PPS_Mapping(19, _OUTPUT, _SDO2);
PPS_Mapping(21, _OUTPUT, _SCK2OUT);
PPS_Mapping(26 ,_INPUT, _SDI2);
delay_ms(100);
SPI2_Init_Advanced(_SPI_MASTER, _SPI_8_BIT, _SPI_PRESCALE_SEC_2, _SPI_PRESCALE_PRI_1, _SPI_SS_DISABLE, _SPI_DATA_SAMPLE_END, _SPI_CLK_IDLE_LOW, _SPI_IDLE_2_ACTIVE);
SPI_Set_Active(SPI2_Read, SPI2_Write);
SerialFlash_init();
SerialFlash_WriteEnable();
Delay_ms(500);


Start_TP();
SetIntroScreen();
Delay_ms(500);
//**************************************************************//
SerialFlash_WriteByte(99 , 0x000001);
Delay_ms(500);
//**************************************************************//
H_Bil = SerialFlash_ReadByte(0x000001);
Delay_ms(500);
//**************************************************************//
while (1) {
Check_TP();

}

}

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: mikroMMB for PIC24 Help

#2 Post by filip » 04 Jul 2011 10:24

Hi,

Is this your custom example, or did you downloaded it from our website ?

Regards,
Filip.

Post Reply

Return to “mikroC PRO for dsPIC30/33 and PIC24 Wish List”