Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC programmer need help

Status
Not open for further replies.

shahrol_hisham

Advanced Member level 4
Joined
Aug 1, 2002
Messages
111
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,298
Location
malaysia
Activity points
869
:02400e00f13f80

Hi..

Can anybody help me on how to write the PIC programmer,
Below is intel hex file format generated from compiler,

:10010000214601360121470136007EFE09D2190140
:100110002146017EB7C20001FF5F16002148011988
:10012000194E79234623965778239EDA3F01B2CAA7
:100130003F0156702B5E712B722B732146013421C7
:00000001FF

Do i need to send all the data to microcontroller or need to send only a partial only
If partial from with location (byte Number) need to send.

Thank
 

decode intel hex file vb

you send all the hex file

in the programmer you select the hex file to program the chip with
 

idc2 pic bulk erase

Now I want to write the programmer using the vb, VB will send the hex file to microcontroller, then microcontroller will send data to microcontroller that want to program,

I have read about the Intel hex format, they have HEX-RECORD TYPES

00 - A record containing data and the 2-byte address at which the data is to
reside.
01 - A termination record for a file of Hex-records. Only one termination record is
allowed per file and it must be the last line of the file. There is no data field.
02 - A segment base address record. This type of record is ignored by Lucid
programmers.

How I shut handle this format? that I need to send/write this to uC, ?

THX
 

eip register microchip

You do not send this file directly to the uC, you send it to the PROGRAMMER.
The programmer uses the additonal info in the file to check that the data has been received correctly and to know where to place the data in the uC's memory.
The programmer has a uC of its own, which does just that and then converts the actual data into a serial stream to program the uC.

Are you trying to build a programmer or to just program a uC?
 

:02000004 pic

Hi VVV

For your info I try to build a programmer.
 

need a programmer in malaysia help do a program

Then I would recommend you build the ICD-2. There are schematics on this board. I know this will not give you the satisfaction of writing the code for it, but it works with MPLAB and supports all the FLASH devices.
Moreover, the firmware can be easily updated from MPLAB to support new devices when they become available.
 

kudelsko pic

Look here: **broken link removed**, serial or paralel port PIC programmer.
 

Yes the IDC2 is nice, but I hope some one can help me on develop the code for programmer. I have read the the hex file note and I find out that for 8 bit controller the compiler will generete the hex code with the type 00 and 01, but when I open the hex generate by MPLAB for pic16F84 I find the type 05 is there.
how should I handle this.
 

Hi

refer the hex below generate from MPLAB
you can see the secound row the '05' is type

If 00 I can just sent to UC for burn but

If (05 - > Start Linear Address Record) what I need to do?

from note the no after type 05 is call EIP

EIP
This field contains eight ASCII hexadecimal digits that specify the 32-bit EIP register contents. The highorder
byte is the 10th/11th character pair.

form hex data below EIP is 28 where should I install the information in the UC?

:020000040000FA
:020000000528D1
:08000800FA288312850183161A
:100010000030850083128601831603308600043089
:10002000A7006400831650308100831230308400B2
:100030008001840A841D182871217821842191214E
:100040009D2138210521AF012A28AF0AFF302F0258
:10005000031912218620F6302006031D25280301EE
:100060002106031D252818089000190891008B20EF
:10007000F5302006031D252803012106031D252830
:02400E00F13F80
:00000001FF
 

OK, so you are trying to build a programmer.
Basically this is what you need to do for a FLASH device:
Put the device in programming mode, by raising /MCLR to 13V, with RB6, RB7 held LOW.
Send a Bulk erase command to the PIC. Send the data to the PIC serially, over ISPDAT, with ISPCLK as the clock. Wait. When done, the part is erased and you can start programming starting at address zero.
receive the data from the PC and separate the bytes that represent the actual data
calculate the checksum and make sure it matches the one received from PC
Now you know the data is good.
1. Send the Load data fro program memory
Send the first byte for program memory
Send the Begin erase programming cycle
Wait for the cycle to complete
Read the data from program memory and check it is OK. Make sure you switch ISPDAT to an input.
Send the Increment address command
Back to step 1

Once you are done with the program memory, send the Load configuration command, then send the configuration word, program it, and then read back and check it.
If all is well the part is programmed and now you take /MCLR below 5V.
Hopefully I did not skip any steps.

Start by reading this document:
https://ww1.microchip.com/downloads/en/DeviceDoc/30277d.pdf
 

Thank.. This help me a lot but I still not understand regarding
the Type '05' in hex file how I should handle the data carry by it.
Can I ignore the data??...... PLS help.
 

You're looking at the wrong byte. The 'type' byte is the fourth byte in the record.

Added after 54 seconds:

You need to study the Programming Specifications documents for the device(s) you're interested in programming.
 

the first Byte is record size
the second and thirth byte are base address (16 bits)
the fourth Byte es type (your first line has type 4 [set high word address to 0000xxxx], and the next is type 0 [data adress] )
then next bytes are data bytes (for example 05 28 means in PIC:2805 == goto 0x005)

the last byte is the checksum byte just for error check

once you understand that, just send the data to the pic...

don't forget that the address in the hex file is in bytes, but in the pic is in words. for example:
:02400E00F13F80

means :
2 data bytes (02)
at address 2007 (400E) its the config word!
type 00 to send to the pic...
content 3FF1 mmmm OSC_XT,PWRT_ON,WDT_OFF
and the checksum...
02h+ 40h +0Eh+ 00h + F1h + 3Fh + 80h === 0!
 

send the hex file to microcontroller, then microcontroller will send data to microcontroller that want to program,
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top