- Joined
- Jan 22, 2008
- Messages
- 53,336
- Helped
- 14,796
- Reputation
- 29,879
- Reaction score
- 14,329
- Trophy points
- 1,393
- Location
- Bochum, Germany
- Activity points
- 302,023
Obviously you did not install XC8 and select it as project tool.I am really tired..
I just copy and paste this code for the work area of MPLAB.......
and Project>Build All
I get 11 errors
#include "htc.h"
__CONFIG(0x0770);
unsigned short tick;
... etc...
OHHHHHHHH...I can do nothing...I dont know what is going? Please help me please
You have to try to learn me the programing? I am Appriciate your hard work...Anyway I can done with your help, If you have time..
In Youtube video, you trying to compile the asm generated by MikroC!!!
Try to open HMS.mcppi in MikroC and compile!!!
IF you use the code:
Code:#include "htc.h" __CONFIG(0x0770); unsigned short tick; ... etc...
This is Hitech C Universal ToolSuite. Use option into the MPLAB like picture bellow:
View attachment 95071
If use XC8 Mplab ToolSuite, change __CONFIG(0x0770); to __PROG_CONFIG( 1, 0x0770);
More: **broken link removed** https://singularengineer.com/programming-pic-18-using-xc8-mplab-x-configuration-bits-2/
// simple test program to Flash LEDs:
// D1 on RB7 at 1 Hz
// D2 on RB6 every 60 seconds
// D3 on RB5 every 360 seconds
// D4 on RB4 every 720 seconds
// Internal oscillator PIC16F88 on EasyPIC7 board
// Warning - this is untested amateur code written in a hurry - plenty of scope for improvement
// global variables
char d2_count;
char d3_count;
char d4_count;
char d2_state = 0;
char d3_state = 0;
char d4_state = 0;
void main() {
TRISB = 0; // all output
PORTB = 0; // all LEDs off
ANSEL = 0; // turn off analogue
OSCCON = 0x72; // select 8MHz internal osc
while(1){ // loop forever
for (d4_count=0 ; d4_count < 2 ; d4_count++){ // 2
for (d3_count=0 ; d3_count < 6 ; d3_count++){ // 6
for (d2_count=0 ; d2_count < 30 ; d2_count++){ // half of 60 for toggle
PORTB.B7 = 1; // LED D1 on
delay_ms(500); // half second delay
PORTB.B7 = 0; // LED D1 off
delay_ms(500); // half second delay
}
d2_state++; // toggle bit 0
PORTB.B6 = d2_state; // toggle LED D2
}
d3_state++;
PORTB.B5 = d3_state; // toggle LED D3
}
d4_state++;
PORTB.B4 = d4_state; // toggle LED D4
}
}
Code C - [expand] 1 ORTB.F7 = 1;
Code C - [expand] 1 ORTB.B7 = 1;
Why? What is the difference? What is wrong with PORTB.B7 ?For mikroC.
instead of
Code C - [expand] 1 PORTB.F7 = 1;
Code C - [expand] 1 PORTB.B7 = 1;
No, that was not the point - I just took that as a typo. I have edited post 28 to make the point clearer.He forgot the P!!!
PORTB.B7 = 1;
Ooops. now I feel silly.B7 doesn't work with mikroC. It works with mikroC PRO.
No, that was not the point - I just took that as a typo. I have edited post 28 to make the point clearer.
The point is... why is F7 better than B7 ?
My understanding is that the two forms are completely equivalent and either is fully acceptable for MikroC compiler, but maybe my understanding is flawed?
EDIT: @manoj madhavan Please ignore posts 27 to 30 - they will not help you with your problem in any way
Zip and post the code and mention the PIC used and Clock frequency. I will Compile with mikroC PRO PIC 6.0.1 and post the files.
Hello Jayanth
You need any payments for this?
Zip and post the code and mention the PIC used and Clock frequency. I will Compile with mikroC PRO PIC 6.0.1 and post the files.
Try this. I Compiled from above code.
You're starting to be abusive. Me and some other guys from here gave you the full code, code that you would have to adjust only by changing some variables to get the timing you want. I tried mine in simulator, and it works. You just have to install a compiler and make fine adjustments. Are you even trying? I don't think so.I want 60 second acurate timing (Acurate Timing).
You're starting to be abusive. Me and some other guys from here gave you the full code, code that you would have to adjust only by changing some variables to get the timing you want. I tried mine in simulator, and it works. You just have to install a compiler and make fine adjustments. Are you even trying? I don't think so.
pityu
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?