| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| Atma 
 
 
 Joined: 08 Aug 2005
 Posts: 22
 
 
 
			    
 
 | 
			
				| loading a file |  
				|  Posted: Tue Nov 01, 2005 10:59 am |   |  
				| 
 |  
				| 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
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Tue Nov 01, 2005 2:41 pm |   |  
				| 
 |  
				|  	  | 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
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Wed Nov 09, 2005 8:19 am |   |  
				| 
 |  
				| 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
 
 
			      
 
 | 
			
				|  |  
				|  Posted: Wed Nov 09, 2005 8:36 am |   |  
				| 
 |  
				| post your code.  There should be a way to do it. |  | 
	
		|  | 
	
		| jds-pic 
 
 
 Joined: 17 Sep 2003
 Posts: 205
 
 
 
			    
 
 | 
			
				| Re: loading a file |  
				|  Posted: Wed Nov 09, 2005 8:49 am |   |  
				| 
 |  
				|  	  | 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
 
 
			    
 
 | 
			
				| pic programmer |  
				|  Posted: Wed Nov 09, 2005 9:53 am |   |  
				| 
 |  
				| 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
 
 
			      
 
 | 
			
				|  |  
				|  Posted: Wed Nov 09, 2005 10:48 am |   |  
				| 
 |  
				| 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. |  | 
	
		|  | 
	
		|  |