Read binary file with mplab

Status
Not open for further replies.
Hi, I already start my project which is related to micro-controller and the first problem is how to read binary file with mplab building language (c language) I try this code but its not took effect plz help me

#include<p18f452.h>
#include<stdio.h>
FILE *e;
void main (void){
e=fopen("c:\nine.bin", "rb");
}
 
There is no file systems built in to the compiler.

"c:\nine.bin", "rb") refers to a file on your hard drive.... What exactly are you trying to do?

ie.. Have you a program file that you want to load onto the chip?
 
There is no file systems built in to the compiler.

"c:\nine.bin", "rb") refers to a file on your hard drive.... What exactly are you trying to do?

ie.. Have you a program file that you want to load onto the chip?

thanx Ian for reply, I try to read binary file as a first step then insert it to EEPROM memory to deal with its data but I think this is not proper way what's ur opinion?
 
thanx Ian for reply, I try to read binary file as a first step then insert it to EEPROM memory to deal with its data but I think this is not proper way what's ur opinion?

No it's not - you're still not very clear though?, are you trying to prgram the PIC? - if so you need a bootloader.
 
If you want to place data "into" the small eeprom on a pic chip MPALB expects you to have a ".xch" file (basically a text file ).. when you open the "eeprom view" you can right click in the window on the first data location and import this file.... Other than that painstakingly write all you values in.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…