Re: 如何自製燒錄線路及程式?
|
||||
---|---|---|---|---|
高級會員
|
No no no...
dear hanxuallan,you are missing from my words...你誤解我的話了! I don't know what the process of burning a hex-file into PIC via "CCS ICD" you have used. Why I told you the hex file format is in order to help you develop the boodloader+downloader programs. I think that using bootloader to "download" your hex file into your pic through rs232 is called ICSP. ICSP can be executed by USART(=rs232) without ICD2(RB6,RB7) or other hardwares. (refer http://ww1.microchip.com/downloads/en/AppNotes/_91015b.pdf) But if you use the kit-"ICD2" to burn the program into pic, well..you don't have to realize the hex-file format. On the other hand, I condiser that how to "import" your hex file and burn it to you PIC chip is what you should know. I suggest you to refer the "MPLAB IDE v.7.22" or "MPLAB ICD2" documents such as "quick start guide"... their links are http://www.microchip.com/stellent/idc ... me=en019469&part=SW007002 http://www.microchip.com/stellent/idc ... me=en010046&part=DV164005 These documents will assist you how to operate the ICD2. Maybe your current requirement is to know how to use your "CCS-ICD" to burn the hex file into PIC, not to realize how to use Microchip's ICD2. Regarding your new questions, my answer are 1) Yes, you got the point. 2) That's what I say "You are missing from my words". But you still ask a point about ICSP tech.- "change position". In the data payload "FF30....", for example, one real data pair should be "30FF", not "FF30", 30 is its high byte, FF is its low byte, don't forget it. 奇怪,你英文那麼好,為何不去美國的forum問呢? Try it! http://forum.microchip.com/ 我真怕我寫的東西其他人看不懂,傷他人眼睛, 況且我英文也不好...寫多了會被笑...
發表於: 2005/12/1 15:38
|
|||
|
Re: 如何自製燒錄線路及程式?
|
||||
---|---|---|---|---|
高級會員
|
There are some C18 functions I writed for 18f4620 memory arrangement.
I wish these codes could help you to realize the memory configuration of pic18. If you want to know the coding format about Hex-file, you can refer the Microchip document "DS00732A", or link to http://www.microchip.com/stellent/idc ... eId=1824&appnote=en011788, see the pages 21-22. After understanding these technique, I guess that you would get more and more questions. God bless you. By the way, to create a protocol or handshaking for bootloader and downloader is a "art". --------------------------------------- #include <p18F4620.h> #include <delays.h> #include <usart.h> void ERASEPGM(unsigned short long Address) { // --- Erase --- EECON1bits.EEPGD=1; // PG Memory EECON1bits.CFGS=0; EECON1bits.WREN=1; EECON1bits.FREE=1; INTCONbits.GIE=0; EECON2=0x55; EECON2=0xAA; EECON1bits.WR=1; INTCONbits.GIE=1; // ------------- } void WritePGM(unsigned char data,unsigned short long Address) { TABLAT=data; // data _asm tblwt // Table Read _endasm EECON1bits.EEPGD=1; EECON1bits.CFGS=0; EECON1bits.WREN=1; INTCONbits.GIE=0; EECON2=0x55; EECON2=0xAA; EECON1bits.WR=1; INTCONbits.GIE=1; EECON1bits.WREN=0; TBLPTR++; } // ---------- EEPROM --------------------------- void WriteEEPROM(unsigned char data,unsigned short long Address) { EEADR=Address; EEDATA=data; EECON1bits.EEPGD=0; // EEPROM EECON1bits.CFGS=0; EECON1bits.WREN=1; INTCONbits.GIE=0; EECON2=0x55; EECON2=0xAA; EECON1bits.WR=1; INTCONbits.GIE=1; EECON1bits.WREN=0; }
發表於: 2005/11/30 14:26
|
|||
|
Re: 如何自製燒錄線路及程式?
|
||||
---|---|---|---|---|
新會員
|
To me84108:
Thanks for your reply. Actually, I just want to try how to build a programmer by myself, currently, I have a CCS ICD-U40. personally, it should be easy to make, but I do not know so far. by the way, I'v already read some information about Bootloader, they let me know many fresh things. Currently, I am reading 'Flash microcontroller Programming specification for pic18f', but I still do not know how to use the famous command - TABLE POINTER, to control target board by my-ICD, that is, Once I get one line Hex code, how to transfer this to target board using table write.... Anyway, Thanks for your help.
發表於: 2005/11/30 10:05
|
|||
|
Re: 如何自製燒錄線路及程式?
|
||||
---|---|---|---|---|
高級會員
|
well,
如果你沒有ICD2,我真的不知道該如何讓程式燒至PIC內! (但是一定可以,只是我不會). 若你要啟動bootload的機制, 至少第一次一定要燒錄一個Bootload的程式在PIC中, 再由rs232 download程式到PIC的program memory. (refer: AN851,AN732) about document 39576b.pdf, 我只有用它的硬體介面(page 1,但我沒用RB5), 跟我的ICD2相接後,可直接燒錄在我的實驗板, 至少燒錄bootload一定要如此做! 若你要問bootload程式哪裡找?這裡可以晃晃.. http://www.etc.ugal.ro/cchiculita/software/picbootloader.htm http://mdubuc.freeshell.org/Colt/ http://www.microchipc.com/ 但是,我不保證可以用唷!(因為有些我沒用過!) 歡迎加入使用PIC的行列! 還有,ICD2ㄧ個大概才4000元左右, 買一個應該不至於動搖國本吧??
發表於: 2005/11/29 20:58
|
|||
|
Re: 如何自製燒錄線路及程式?
|
||||
---|---|---|---|---|
新會員
|
39576b.pdf
I read this file already, but I still do not know how to do. please help me~~~~ All table commands are 4 bits Instruction, such as : '1100' is Table write, and folowing 16 bits Data Payload, but I donot know what should I put into this 16 bits? Is it from Hex file? So, can you give me a simple example? Thanks a lot!參照:
發表於: 2005/11/29 18:00
|
|||
|
Re: 如何自製燒錄線路及程式?
|
||||
---|---|---|---|---|
版主
|
PIC16 與 PIC18 的燒錄方式是不一樣的,PIC16直接送串列的燒錄資料而PIC18要送Table Write Command 的方式來燒錄。
這樣說吧! PIC18 的燒錄比較複雜。 有興趣可參考燒錄的規格,如下所示: dsPIC : http://ww1.microchip.com/downloads/en/DeviceDoc/70102d.pdf PIC18Fxxxx : http://ww1.microchip.com/downloads/en/DeviceDoc/39576b.pdf
發表於: 2005/2/16 14:37
|
|||
|
Re: 如何自製燒錄線路及程式?
|
||||
---|---|---|---|---|
初級會員
|
參照:
該文件我有看過: 只有提到12C5XX,16CXX,17CXX,16F8XX 沒有提到線路在18FXX及dsPIC30FXX可否使用? Programming Specification是否相同? 程式要否調整? 報歉問了許多問題!
發表於: 2005/2/16 3:02
|
|||
|
Re: 如何自製燒錄線路及程式?
|
||||
---|---|---|---|---|
版主
|
在Microchip網站上找 DS30277D 有詳細的 ICSP 程式與電路。
發表於: 2005/2/15 15:10
|
|||
|
如何自製燒錄線路及程式?
|
||||
---|---|---|---|---|
初級會員
|
如果沒有MPLAB ICD2或燒錄器的話,
有沒有簡單的線路及程式可以直接將.HEX或.BIN燒到 PIC18FXXX或dsPIC30FXX等cpu上 或應該reference which document? 或是有更便宜的ICSP KITS 謝謝!
發表於: 2005/2/15 14:41
|
|||
|