Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Hahahaha! These things are all SOOO urgent. Hehehe! What happened? Did you leave your class assignment till the last couple days before it's due? Good luck with learning C in a couple days.hi there, i wanna ask if anybody know what software used to convert C codes to HEX file and how to do it....i'm using PIC16F876a..
Please help me..i'm new/noob in these thing..Plus its urgent thou..
kindaHahahaha! These things are all SOOO urgent. Hehehe! What happened? Did you leave your class assignment till the last couple days before it's due?
Really! I think you're the first to actually admit it here though.kinda
Who wrote your source code? What compiler did they write it for? You may be better off to get that compiler to save you having to port the source code to suit a different compiler's syntax. They all have their own ways of doing things. It's still C, but there are compiler-specific syntax differences (include file equates, etc.). If it's a small program it's not a big deal, but if it's large it can be quite a chore.can u explain to me more about this "SourceBoost BoostC."... does it writes C codes straight to PIC? By da way, i've done with writing on C.... i just don't know how to "burn-to-project" part.... kinda sucks at these thing..
is it MPLAB C Compiler for PIC18 MCUs?Given the questions you're asking, I think you should figure out what compiler this code was written for, most likely microchip's c18 compiler. Download it from microchip.com
Or you could do it the old fashioned way: compile by hand ( convert C to assembly ), assemble by hand ( look up all the hex codes in an instruction code table ), and then enter them all into a .hex text file.
Of course when I learned it I had to enter them manually into a hex keypad.
Your code is almost certainly written for Hi-Tech's PICC compiler, which uses the pic.h header.C:\Documents and Settings\FysL\Desktop\Source Code\test\test.c(10): Unable to open include file: pic.h
1 errors detected
#include <system.h>
#pragma CLOCK_FREQ 20000000
#pragma DATA _CONFIG1H, _HS_OSC_1H
#pragma DATA _CONFIG2H, _WDT_OFF_2H
#pragma DATA _CONFIG4L, _LVP_OFF_4L
void main(void)
{
int i;
trisc=0;
while(1){
for(i=0;i<256;i++){
latc.3=1;
delay_10us(i);
latc.3=0;
delay_ms(5);
}
delay_ms(50);
Here's the first lines of a typical BoostC program for an 18F448. The CLOCK_FREQ will have to be adjusted to suit your setup. The configs will be different for 16F's. A 16F will usually have only one line.
Code:#include <system.h> #pragma CLOCK_FREQ 20000000 #pragma DATA _CONFIG1H, _HS_OSC_1H #pragma DATA _CONFIG2H, _WDT_OFF_2H #pragma DATA _CONFIG4L, _LVP_OFF_4L void main(void) { int i; trisc=0; while(1){ for(i=0;i<256;i++){ latc.3=1; delay_10us(i); latc.3=0; delay_ms(5); } delay_ms(50);
No. Why would you even think that?what do i have to do with this code?
make a new file.. and name it as system.h?
Replace the pic.h header line in your program with the system.h one.
#pragma CLOCK_FREQ 4000000
#pragma DATA 0x2007, 0x184
#include <system.h>
Then you'll have to make some other changes to suit differences in how the two compilers name things like registers, and how they access bits in registers.
can someone convert these code to asm and hex...
i dont think i'm capable to do this anymore...
i've trying for a month and using many compilers...
and i have to send this thing on 8/11..
You'll find quite a bit of simple "example" BoostC code at my web-site. With that and the BoostC manual you should be able to figure out the changes to make.could u help me..
i get this one..
is it like thisi dont know about this can u help me..Code:#pragma CLOCK_FREQ 4000000 #pragma DATA 0x2007, 0x184 #include <system.h>
Much easier than using a hex number and having to look up which bits are being set or reset in the data sheet.#pragma DATA _CONFIG, _XT_OSC & _WDT_OFF & _CP_OFF & _PWRTE_OFF