CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

loading a file

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Atma



Joined: 08 Aug 2005
Posts: 22

View user's profile Send private message

loading a file
PostPosted: Tue Nov 01, 2005 10:59 am     Reply with quote

Hi there

I need some help. I am making a PIC programmer where a PIC programs another PIC. I have manged to be able to read the device ID fro the device and erase it as well. now i am trying to program the device. I sort of know the programming procedure. for testing purposes i am going to try to use hyperterminal to load a file into the programming PICs EEPROM memory. What i would like to know is how do i receive the file and store it into EEPROM memory and the next question is how would my program procedure access the file and start loading it onto the target device? would it store it into a buffer for instance and can it laod the hex file as it is or does it have to change the format?

please help
thanks in advance
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Nov 01, 2005 2:41 pm     Reply with quote

Quote:

What i would like to know is how do i receive the file and store it into
EEPROM memory and the next question is how would my program
procedure access the file and start loading it onto the target device ?
Would it store it into a buffer for instance and can it load the hex file
as it is or does it have to change the format ?

Look at the CCS driver file, LOADER.C, which is in this folder:
C:\Program Files\PICC\Drivers
It contains code to receive a HEX file over the serial port, and
convert it into binary bytes.
Atma



Joined: 08 Aug 2005
Posts: 22

View user's profile Send private message

PostPosted: Wed Nov 09, 2005 8:19 am     Reply with quote

Hi there

Thanks for letting me know about the Loader.c file. I think it is what i require to receive the hex file from across.

I have a few questions though that i need to ask.

1)I realised that the file is using flow control in order to work. my hardware programmer circuit is using serial communication and the pins that it is using are the TXD pin,the RXD pin and the GND pin. Will it work with only those three pins used? in the sense that i am not using any of the handshaking lines and stuff on the PIC side of things.

2)I tried to add it to my project but what happened was that it gives me an error saying that "Arrays of bits are not permited". how do i slove that?

3)When i tried to put it in a new project separately, it gave me the error saying "not enough RAM available". how would i solve that?

thanks in advance
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Wed Nov 09, 2005 8:36 am     Reply with quote

post your code. There should be a way to do it.
jds-pic



Joined: 17 Sep 2003
Posts: 205

View user's profile Send private message

Re: loading a file
PostPosted: Wed Nov 09, 2005 8:49 am     Reply with quote

Atma wrote:
i am going to try to use hyperterminal to load a file into the programming PICs EEPROM memory.

step 1, stop using hyperterminal. it's useless and potentially the source of problems.

jds-pic
TIMT



Joined: 02 Sep 2005
Posts: 49
Location: Nottingham, UK

View user's profile Send private message

pic programmer
PostPosted: Wed Nov 09, 2005 9:53 am     Reply with quote

Just for your info, I made a pic programmer for the 16F873/4/6/7 devices but I just copied the contents from one master PIC to another identical destination PIC, reading the word from the first address of one, putting it into a variable then squirting it into the destination PIC, then so on for all the memory locations including the id and config registers. This was a lot easier than reading the data from eeprom as the same routines can be used for both devices. If the destination PIC needs code protecting, this is done at the end. The source PIC must not be code protected. The code was in assembly though. This might be a way to do it.
_________________
Tim
Douglas Kennedy



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

PostPosted: Wed Nov 09, 2005 10:48 am     Reply with quote

I couldn't agree more about hyperterminal....it is not the most reliable way to go...teraterm ( download from the web) or CCS's SIO ( comes with the PCWH IDE ) are much superior.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group