coolvasanth07
Member level 1
- Joined
- Sep 25, 2012
- Messages
- 37
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Activity points
- 1,506
// Device setup
#include "16F877A.h"
#device *=16
#device adc=10
#device *=16
#device adc=10
#include<16F877A.h>
#use delay(clock=20000000)
#byte PORT_B=6;
void main()
{
set_tris_b(0);
PORTB=0;
while(true)
{
output_b(0xff);
delay_ms(1000);
output_b(0x00);
delay_ms(1000);
}
}
#include<16F877A.h>
#device *=16
#device adc=10
#use delay(clock=20000000)
#byte PORT_B=6;
void main()
{
set_tris_b(0);
PORTB=0;
while(true)
{
output_b(0xff);
delay_ms(1000);
output_b(0x00);
delay_ms(1000);
}
}
#include "16F877A.h"
#device *=16
#device adc=10
#use delay(clock=20000000)
#byte PORT_B=6;
void main()
{
set_tris_b(0);
PORTB=0;
while(true)
{
output_b(0xff);
delay_ms(1000);
output_b(0x00);
delay_ms(1000);
}
}
#include <16F877A.h>
#device adc=16
#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#use delay(clock=20000000)
#byte Port_B=6
void main()
{
Port_B=0;
while(true)
{
output_b(0xff);
delay_ms(1000);
output_b(0x00);
delay_ms(1000);
}
}
"If a full path is not specified the compiler will use the list of directories specified for the project to search for the file. If the filename is in "" then the directory with the main source file is searched first. If the filename is in <> then the directory with the main source file is searched last."
#include <16F877A.h>
#device adc=16
#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#use delay(clock=20000000)
#byte Port_B=6
void main()
{
Port_B=0;
while(true)
{
output_b(0xff);
delay_ms(1000);
output_b(0x00);
delay_ms(1000);
}
}
what can i do, plz tell me..Executing: "C:\Program files\Picc\CCSC.exe" +FM "led.c" +DF +LN +T +A +M +Z +Y=9 +EA
*** Error 18 "led.c" Line 1(9,20): File can not be opened
Not in project "C:\Documents and Settings\JAVA9\Desktop\AAA\16F877A.h"
*** Error 128 "led.c" Line 2(9,15): A #DEVICE required before this line
*** "led.c" Line 4: Error #111: Unknown keyword in #FUSES "NOWDT"
*** "led.c" Line 5: Error #111: Unknown keyword in #FUSES "HS"
*** "led.c" Line 6: Error #111: Unknown keyword in #FUSES "NOBROWNOUT"
*** "led.c" Line 7: Error #111: Unknown keyword in #FUSES "NOLVP"
*** "led.c" Line 11: Error #128: A #DEVICE required before this line
7 Errors, 0 Warnings.
Halting build on first failure as requested.
BUILD FAILED: Wed Jan 02 09:43:33 2013
Code C - [expand] 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 #include "C:\Users\xyz1\Desktop\xyz_new\lab tutorial.h" #include <16F877A.h> #device adc=16 #FUSES NOWDT //No Watch Dog Timer #FUSES HS //High speed Osc(>4mhz for PCM/PCH) (>10mhz for PCD) #FUSES NOBROWNOUT //No brownout reset #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O #use delay(clock=20000000) #byte Port_B=6 void main() { Port_B=0; while(true) { output_b(0xff); delay_ms(1000); output_b(0x00); delay_ms(1000); } }
xxx Error 23 " C:\Program files (x86)\PICC\devices\16F877A.h" Line 2(8,9): Can not change device type this far into the code
xxx Error 48 " C:\Program files (x86)\PICC\devices\16F877A.h" Line 164(1,23): Expecting a (
xxx Error 48 " C:\Program files (x86)\PICC\devices\16F877A.h" Line 164(6,11): Expecting a (
xxx Info 300 " C:\Program files (x86)\PICC\devices\16F877A.h" Line 168(6,11): More info: First Declaration of CCP_2
xxx Error 31 " C:\Program files (x86)\PICC\devices\16F877A.h" Line 168(6,11): I dentifier is already used in this scope
OK, I can compile that program without problems, so it seems that you have an additional path problem. Do the following: Open CCS C compiler and go to Menu -> Options -> Project Options. It opens a new window in which you should see the following in the 'Files' tab:
- Target: PIC16F877A
- Source Files: led.c
- Project Filename: C:\Documents and Settings\JAVA9\Desktop\AAA\led.pjt
Then in the 'Include Files' tab:
- Include File Search Order:
C:\Program Files\PICC\devices
C:\Program Files\PICC\drivers
If you find any differences, then correct it and try again. What compiler version do you have?
Best Regards!
#include <16F877A.h>
#device adc=16
#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#use delay(clock=20000000)
#define LED PIN_B0
#define DELAY 1000
void main()
{
//Example blinking LED program
while(true)
{
output_low(LED);
delay_ms(DELAY);
output_high(LED);
delay_ms(DELAY);
}
}
Hi bioda, can we see the contents of the file: C:\Users\xyz1\Desktop\xyz_new\lab tutorial.h? Also you can try to compile the code without that line. It seems that in that file has already been declared the PIC's library.
Best Regards!
- - - Updated - - -
If you want lo learn CCS (That is really easy) it is best to use the instructions specific to the CCS C compiler to realize their full potential. Here an example to turn on and off a LED:
Code:#include <16F877A.h> #device adc=16 #FUSES NOWDT //No Watch Dog Timer #FUSES HS //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD) #FUSES NOBROWNOUT //No brownout reset #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O #use delay(clock=20000000) #define LED PIN_B0 #define DELAY 1000 void main() { //Example blinking LED program while(true) { output_low(LED); delay_ms(DELAY); output_high(LED); delay_ms(DELAY); } }
Best regards!
OK, I can compile that program without problems, so it seems that you have an additional path problem. Do the following: Open CCS C compiler and go to Menu -> Options -> Project Options. It opens a new window in which you should see the following in the 'Files' tab:
- Target: PIC16F877A
- Source Files: led.c
- Project Filename: C:\Documents and Settings\JAVA9\Desktop\AAA\led.pjt
Then in the 'Include Files' tab:
- Include File Search Order:
C:\Program Files\PICC\devices
C:\Program Files\PICC\drivers
If you find any differences, then correct it and try again. What compiler version do you have?
Best Regards!
My compiler version >> "CCS C 4.105 Full"
Hi coolvasanth07, did you the tests that I told you? was everything OK?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?