Ram Prasadh
Member level 2
Hi
I am presently on a project regarding spi in pic16f72. I get a problem when I build this codeIt states like
"Error [1091] C:\Program Files\HI-TECH Software\PICC\9.71a\sources\float.c; 86. main function "_main" not defined".
My code is below and I have also given the output window. Please help me with this Problem.
#include<htc.h>
void spi();
void delay();
typedef unsigned int word;
word __at 0x2007 CONFIG = _HS_OSC & _WDT_OFF & _PWRTE_OFF & _CP_OFF & _BODEN_ON;
#define SS PORTAbits.RA5//slave select bit is assigned to porta 5th pin
void main(void)
{
ADCON1=0x06;//configured as digital and not analog
TRISA=0;
TRISC=0;
TRISCbits.TRISC4=1;// SDI is made as an input,SCK,SDO are output
spi();
}
while(1)
{
void spi()
{
/*_ _ _ _ _ _ _ _ _ SSP CONFIGIRATION_ _ _ _ _ _ _ _ _ */
SSPCON=0b00110001;
SSPSTAT=0b10000000;
SS=0x00;
WREG=0x23;
SSPBUF=WREG;
while(BF=0x00);
PORTB=SSPBUF;
SS=1;
}
}
my output comes like this:
Build C:\Documents and Settings\RAM PRASADH\My Documents\pic\spi for device 16F72
Using driver C:\Program Files\HI-TECH Software\PICC\9.71a\bin\picc.exe
Make: The target "C:\Documents and Settings\RAM PRASADH\My Documents\pic\SPI2.p1" is up to date.
Executing: "C:\Program Files\HI-TECH Software\PICC\9.71a\bin\picc.exe" -ospi.cof -mspi.map --summary=default,-psect,-class,+mem,-hex --output=default,+inhx032 SPI2.p1 --chip=16F72 -P --runtime=default,+clear,+init,-keep,+osccal,+download,-resetbits,-stackcall,+clib --opt=default -D__DEBUG=1 -g --asmlist "--errformat=Error [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
Licensed for evaluation purposes only.
This licence will expire on Thu, 12 May 2011.
HI-TECH C Compiler for PIC10/12/16 MCUs (PRO Mode) V9.71a
Copyright (C) 2010 Microchip Technology Inc.
Error [1091] C:\Program Files\HI-TECH Software\PICC\9.71a\sources\float.c; 86. main function "_main" not defined
********** Build failed! **********
Help me Please......
I am presently on a project regarding spi in pic16f72. I get a problem when I build this codeIt states like
"Error [1091] C:\Program Files\HI-TECH Software\PICC\9.71a\sources\float.c; 86. main function "_main" not defined".
My code is below and I have also given the output window. Please help me with this Problem.
#include<htc.h>
void spi();
void delay();
typedef unsigned int word;
word __at 0x2007 CONFIG = _HS_OSC & _WDT_OFF & _PWRTE_OFF & _CP_OFF & _BODEN_ON;
#define SS PORTAbits.RA5//slave select bit is assigned to porta 5th pin
void main(void)
{
ADCON1=0x06;//configured as digital and not analog
TRISA=0;
TRISC=0;
TRISCbits.TRISC4=1;// SDI is made as an input,SCK,SDO are output
spi();
}
while(1)
{
void spi()
{
/*_ _ _ _ _ _ _ _ _ SSP CONFIGIRATION_ _ _ _ _ _ _ _ _ */
SSPCON=0b00110001;
SSPSTAT=0b10000000;
SS=0x00;
WREG=0x23;
SSPBUF=WREG;
while(BF=0x00);
PORTB=SSPBUF;
SS=1;
}
}
my output comes like this:
Build C:\Documents and Settings\RAM PRASADH\My Documents\pic\spi for device 16F72
Using driver C:\Program Files\HI-TECH Software\PICC\9.71a\bin\picc.exe
Make: The target "C:\Documents and Settings\RAM PRASADH\My Documents\pic\SPI2.p1" is up to date.
Executing: "C:\Program Files\HI-TECH Software\PICC\9.71a\bin\picc.exe" -ospi.cof -mspi.map --summary=default,-psect,-class,+mem,-hex --output=default,+inhx032 SPI2.p1 --chip=16F72 -P --runtime=default,+clear,+init,-keep,+osccal,+download,-resetbits,-stackcall,+clib --opt=default -D__DEBUG=1 -g --asmlist "--errformat=Error [%n] %f; %l.%c %s" "--msgformat=Advisory[%n] %s" "--warnformat=Warning [%n] %f; %l.%c %s"
Licensed for evaluation purposes only.
This licence will expire on Thu, 12 May 2011.
HI-TECH C Compiler for PIC10/12/16 MCUs (PRO Mode) V9.71a
Copyright (C) 2010 Microchip Technology Inc.
Error [1091] C:\Program Files\HI-TECH Software\PICC\9.71a\sources\float.c; 86. main function "_main" not defined
********** Build failed! **********
Help me Please......