This is my code. I copied it from help of MANCHESTER library. And getting these error "main function not defined"
Please help me...
// LCD module connections
sbit LCD_RS at RB4_bit;
sbit LCD_EN at RB5_bit;
sbit LCD_D4 at RB0_bit;
sbit LCD_D5 at RB1_bit;
sbit LCD_D6 at RB2_bit;
sbit LCD_D7 at RB3_bit;
sbit LCD_RS_Direction at TRISB4_bit;
sbit LCD_EN_Direction at TRISB5_bit;
sbit LCD_D4_Direction at TRISB0_bit;
sbit LCD_D5_Direction at TRISB1_bit;
sbit LCD_D6_Direction at TRISB2_bit;
sbit LCD_D7_Direction at TRISB3_bit;
// End LCD module connections
// Manchester module connections
sbit MANRXPIN at RC0_bit;
sbit MANRXPIN_Direction at TRISC0_bit;
sbit MANTXPIN at RC1_bit;
sbit MANTXPIN_Direction at TRISC1_bit;
// End Manchester module connections
char error, ErrorCount, temp;
void main() {
ErrorCount = 0;
ANSEL = 0; // Configure AN pins as digital I/O
ANSELH = 0;
TRISC.F5 = 0;
Lcd_Init(); // Initialize LCD
Lcd_Cmd(_LCD_CLEAR); // Clear LCD display
Man_Receive_Init(); // Initialize Receiver
while (1) { // Endless loop
Lcd_Cmd(_LCD_FIRST_ROW); // Move cursor to the 1st row
while (1) { // Wait for the "start" byte
temp = Man_Receive(&error); // Attempt byte receive
if (temp == 0x0B) // "Start" byte, see Transmitter example
break; // We got the starting sequence
if (error) // Exit so we do not loop forever
break;
}
do
{
temp = Man_Receive(&error); // Attempt byte receive
if (error) { // If error occured
Lcd_Chr_CP('?'); // Write question mark on LCD
ErrorCount++; // Update error counter
if (ErrorCount > 20) { // In case of multiple errors
temp = Man_Synchro(); // Try to synchronize again
//Man_Receive_Init(); // Alternative, try to Initialize Receiver again
ErrorCount = 0; // Reset error counter
}
}
else { // No error occured
if (temp != 0x0E) // If "End" byte was received
// (see Transmitter example)
Lcd_Chr_CP(temp); // do not write received byte on LCD
}
Delay_ms(25);
}while (temp != 0x0E); // If "End" byte was received exit do loop
}
}
ERROR "main function not defined"
ERROR "main function not defined"
http://microcontrollerprojects00.blogspot.com/
ARM, PIC , AVR, 8051 Projects/Tutorials (MikroC)
If you get, give. If you learn, teach.
ARM, PIC , AVR, 8051 Projects/Tutorials (MikroC)
If you get, give. If you learn, teach.
Re: ERROR "main function not defined"
When i copy the main function to MikroC avr it works fine this is the code
// LCD module connections
sbit LCD_RS at PORTD2_bit;
sbit LCD_EN at PORTD3_bit;
sbit LCD_D4 at PORTD4_bit;
sbit LCD_D5 at PORTD5_bit;
sbit LCD_D6 at PORTD6_bit;
sbit LCD_D7 at PORTD7_bit;
sbit LCD_RS_Direction at DDD2_bit;
sbit LCD_EN_Direction at DDD3_bit;
sbit LCD_D4_Direction at DDD4_bit;
sbit LCD_D5_Direction at DDD5_bit;
sbit LCD_D6_Direction at DDD6_bit;
sbit LCD_D7_Direction at DDD7_bit;
// End LCD module connections
// Manchester module connections
sbit MANRXPIN at PINB0_bit;
sbit MANRXPIN_Direction at DDB0_bit;
sbit MANTXPIN at PORTB1_bit;
sbit MANTXPIN_Direction at DDB1_bit;
// End Manchester module connections
char error, ErrorCount, temp;
void main() {
ErrorCount = 0;
//ANSEL = 0; // Configure AN pins as digital I/O
//ANSELH = 0;
//C1ON_bit = 0; // Disable comparators
//C2ON_bit = 0;
//TRISC.F5 = 0;
Lcd_Init(); // Initialize LCD
Lcd_Cmd(_LCD_CLEAR); // Clear LCD display
Man_Receive_Init(); // Initialize Receiver
while (1) { // Endless loop
Lcd_Cmd(_LCD_FIRST_ROW); // Move cursor to the 1st row
while (1) { // Wait for the "start" byte
temp = Man_Receive(&error); // Attempt byte receive
if (temp == 0x0B) // "Start" byte, see Transmitter example
break; // We got the starting sequence
if (error) // Exit so we do not loop forever
break;
}
do
{
temp = Man_Receive(&error); // Attempt byte receive
if (error) { // If error occured
Lcd_Chr_CP('?'); // Write question mark on LCD
ErrorCount++; // Update error counter
if (ErrorCount > 20) { // In case of multiple errors
temp = Man_Synchro(); // Try to synchronize again
//Man_Receive_Init(); // Alternative, try to Initialize Receiver again
ErrorCount = 0; // Reset error counter
}
}
else { // No error occured
if (temp != 0x0E) // If "End" byte was received(see Transmitter example)
Lcd_Chr_CP(temp); // do not write received byte on LCD
}
Delay_ms(25);
}
while (temp != 0x0E) ; // If "End" byte was received exit do loop
}
}
// LCD module connections
sbit LCD_RS at PORTD2_bit;
sbit LCD_EN at PORTD3_bit;
sbit LCD_D4 at PORTD4_bit;
sbit LCD_D5 at PORTD5_bit;
sbit LCD_D6 at PORTD6_bit;
sbit LCD_D7 at PORTD7_bit;
sbit LCD_RS_Direction at DDD2_bit;
sbit LCD_EN_Direction at DDD3_bit;
sbit LCD_D4_Direction at DDD4_bit;
sbit LCD_D5_Direction at DDD5_bit;
sbit LCD_D6_Direction at DDD6_bit;
sbit LCD_D7_Direction at DDD7_bit;
// End LCD module connections
// Manchester module connections
sbit MANRXPIN at PINB0_bit;
sbit MANRXPIN_Direction at DDB0_bit;
sbit MANTXPIN at PORTB1_bit;
sbit MANTXPIN_Direction at DDB1_bit;
// End Manchester module connections
char error, ErrorCount, temp;
void main() {
ErrorCount = 0;
//ANSEL = 0; // Configure AN pins as digital I/O
//ANSELH = 0;
//C1ON_bit = 0; // Disable comparators
//C2ON_bit = 0;
//TRISC.F5 = 0;
Lcd_Init(); // Initialize LCD
Lcd_Cmd(_LCD_CLEAR); // Clear LCD display
Man_Receive_Init(); // Initialize Receiver
while (1) { // Endless loop
Lcd_Cmd(_LCD_FIRST_ROW); // Move cursor to the 1st row
while (1) { // Wait for the "start" byte
temp = Man_Receive(&error); // Attempt byte receive
if (temp == 0x0B) // "Start" byte, see Transmitter example
break; // We got the starting sequence
if (error) // Exit so we do not loop forever
break;
}
do
{
temp = Man_Receive(&error); // Attempt byte receive
if (error) { // If error occured
Lcd_Chr_CP('?'); // Write question mark on LCD
ErrorCount++; // Update error counter
if (ErrorCount > 20) { // In case of multiple errors
temp = Man_Synchro(); // Try to synchronize again
//Man_Receive_Init(); // Alternative, try to Initialize Receiver again
ErrorCount = 0; // Reset error counter
}
}
else { // No error occured
if (temp != 0x0E) // If "End" byte was received(see Transmitter example)
Lcd_Chr_CP(temp); // do not write received byte on LCD
}
Delay_ms(25);
}
while (temp != 0x0E) ; // If "End" byte was received exit do loop
}
}
http://microcontrollerprojects00.blogspot.com/
ARM, PIC , AVR, 8051 Projects/Tutorials (MikroC)
If you get, give. If you learn, teach.
ARM, PIC , AVR, 8051 Projects/Tutorials (MikroC)
If you get, give. If you learn, teach.
Re: ERROR "main function not defined"
Hi,
I believe I have answered you here :
http://www.mikroe.com/forum/viewtopic.php?f=13&t=15952
Regards,
Filip.
I believe I have answered you here :
http://www.mikroe.com/forum/viewtopic.php?f=13&t=15952
Regards,
Filip.
Re: ERROR "main function not defined"
I have seen the post...
Actually i didn't include the source file where i pasted the code. I dont know how to include the source to project manager. Normally its not necessary to include it, what is the difference?
Actually i didn't include the source file where i pasted the code. I dont know how to include the source to project manager. Normally its not necessary to include it, what is the difference?
http://microcontrollerprojects00.blogspot.com/
ARM, PIC , AVR, 8051 Projects/Tutorials (MikroC)
If you get, give. If you learn, teach.
ARM, PIC , AVR, 8051 Projects/Tutorials (MikroC)
If you get, give. If you learn, teach.
Re: ERROR "main function not defined"
Thank you... I compiled and simulated successfully.
I need some help fo DS1307 RTC...is there any library for that?
I need some help fo DS1307 RTC...is there any library for that?
http://microcontrollerprojects00.blogspot.com/
ARM, PIC , AVR, 8051 Projects/Tutorials (MikroC)
If you get, give. If you learn, teach.
ARM, PIC , AVR, 8051 Projects/Tutorials (MikroC)
If you get, give. If you learn, teach.
Re: ERROR "main function not defined"
Hi,
We have the sample code for DS1307, which can be found here :
http://www.mikroe.com/eng/products/view/197/rtc2-board/
Regards,
Filip.
We have the sample code for DS1307, which can be found here :
http://www.mikroe.com/eng/products/view/197/rtc2-board/
Regards,
Filip.
Re: ERROR "main function not defined"
But the sample code cannot reset or change the time? How can i change the time?
And schematics. If thre is no library is ther any way to get the commands for DS1307?
Thank You for your help
And schematics. If thre is no library is ther any way to get the commands for DS1307?
Thank You for your help
http://microcontrollerprojects00.blogspot.com/
ARM, PIC , AVR, 8051 Projects/Tutorials (MikroC)
If you get, give. If you learn, teach.
ARM, PIC , AVR, 8051 Projects/Tutorials (MikroC)
If you get, give. If you learn, teach.
Re: ERROR "main function not defined"
Hi,
For the commands list, please refer to the DS1307 datasheet :
http://datasheets.maxim-ic.com/en/ds/DS1307.pdf
Regards,
Filip.
For the commands list, please refer to the DS1307 datasheet :
http://datasheets.maxim-ic.com/en/ds/DS1307.pdf
Regards,
Filip.