![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | Thread Tools | Display Modes |
| | (permalink) |
| Experienced Member | I have started reading about ways of PIC programming just a short while ago but I think I am a little lost. Now the way I see it, there is something called in-circuit programming. So if I am interested in sending the PICs new programs WHILE THEY ARE ALREADY PLACED IN THEIR EMBEDDED SYSTEM, I can send the new hex file serially by controlling the RB6, RB7, and master clear pins? How do I do that or how do I control the sequence of voltages on these pins because I read a tutorial and it said that when the PIC is being programmed, the master clear is set to low and then quickly to 12 volts and so on. How do I manage that sequence? And when do I need a boot loader?! Do I need it for in-circuit programming or for just programming the PIC in a certain circuit without a programmer and then placing the PIC in its circuit? I know these are lots of questions but I got really confused and I would appreciate your help.
__________________ World.......behold........YAN is coming |
| | |
| | (permalink) | |
| Super Moderator | Quote:
Bootloader is a way of programming PIC, when there is a small program inside PIC, that is "listening" until it's called (usually it listens shortly after RESET) and if it finds out there is a demand for programming it enters program mode and programs the PIC with Data comming into PIC usually from serial port. If bootloader did not detect request to enter program mode, it runs main program as usual. Check out my Sig for more info about Tiny PIC bootloader!
__________________ "I share, thus I am" Jay.slovak Read this! ICD2 Clone Best PIC/DsPIC Bootloader Read my Inchworm ICD2 review! | |
| | |
| | (permalink) |
| Experienced Member | All modern PIC only have ICSP (In Circuit Serial Programing)The programers that you put the PIC in use ICSP And yes you can program it wen its in the circuit IF the circuit is built that way. You need to aply 13V to MCRL to get it in programing mode.wile providing the 5V suply.Then the PIC comunicates serialy whith the PC (one pin is the clock and the other is data)
__________________ Il give you shocking experience. |
| | |
| | (permalink) |
| Experienced Member | jay you ware just a cuple of seconds faster than me! (check the time stamp on top of the posts)
__________________ Il give you shocking experience. |
| | |
| | (permalink) | |
| Super Moderator | Quote:
__________________ "I share, thus I am" Jay.slovak Read this! ICD2 Clone Best PIC/DsPIC Bootloader Read my Inchworm ICD2 review! | |
| | |
| | (permalink) |
| Experienced Member | Why didnt you write some more so i cod be first
__________________ Il give you shocking experience. |
| | |
| | (permalink) | |
| Super Moderator | Quote:
__________________ "I share, thus I am" Jay.slovak Read this! ICD2 Clone Best PIC/DsPIC Bootloader Read my Inchworm ICD2 review! | |
| | |
| | (permalink) |
| Experienced Member | I see. But for my project (a pentium 4 on a mother board is communicating with PICs), I am interested in sending and receiving data serially between the PICs and the CPU. Now this has to be done by connecting the serial cable to the RX and TX pins of the PIC, right? And I am ALSO interested in allowing the CPU to send the PICs new programs during their operation (ICSP). So in order to do this, I have to connect the serial cable to the RB6, RB7, and master clear pins?! So do I need two serial ports or what? And when programming the PICs, I just send the .HEX file serially to the RB7 pin?
__________________ World.......behold........YAN is coming |
| | |
| | (permalink) | |
| Super Moderator | Quote:
For PIC to communicate with PC you need MAX232 level shifter (yes PICs TX and RX PINs). With that IC you can easily send bytes from and to PIC. ICSP is a type of programming when PIC is NOT running and is programmed by RB6/7 PINs (by IC-prog SW and JDM HW). If you want to "upgrade the program" in PIC via Serial, you will need bootloader...
__________________ "I share, thus I am" Jay.slovak Read this! ICD2 Clone Best PIC/DsPIC Bootloader Read my Inchworm ICD2 review! | |
| | |
| | (permalink) |
| Experienced Member | Yeah I know that I need the MAX level shifter. But I am confused about the ICSP part. In my project, I need the PICs to be blank at first and then the pentium sends them their programs. So for that, I need a JDM programmer, right? And if the CPU has to send the PICs new programs ('update' their programs)over and over, it has to send the PICs the boot loader the first time as well? (of course, I don't know what a JDM is I will be extremely grateful is you gave me a 'yes' or a 'no' for each of these questions with a short explanation in case of the 'no'.
__________________ World.......behold........YAN is coming |
| | |
| | (permalink) |
| Experienced Member | JDM is a name of a programer and its powerd by the serial port (no external pover neded) The programer is realy simple all it dose is thruns on/off Vpp,Vdd and sends/recives data from the PC and PIC An programer can be made out of 2 transostors and a cuple of resistors. An programer can be on the LPT port too or even the USB but USB is a prety complicated interface
__________________ Il give you shocking experience. |
| | |
| | (permalink) |
| Experienced Member | ha now im the first. :twisted:
__________________ Il give you shocking experience. |
| | |
| | (permalink) | |
| Super Moderator | Quote:
Yes, you need JDM programmer to program blank PICs. JDM (read my sticky) is a serial based programmer that takes care of all voltage levels and timings and with co-operation of Ic-prog programs the PIC. If you want to update programs via serial (using bootloader), yes you have to program bootloader routine first (JDM+Ic-prog) and then you can update programs with regular serial connection. SO: ICSP= used to program PICs while they are incircuit with cooperation of special HW (JDM is using serial port). It is used to program blank PICs Bootloader= smal piece of SW that is programmed in PIC and connected to PC via standart serial connection (you also have to run Bootloader PC program). Usefull for updating programs if you can't access PCB and is saving RB6/7 pins of PIC.
__________________ "I share, thus I am" Jay.slovak Read this! ICD2 Clone Best PIC/DsPIC Bootloader Read my Inchworm ICD2 review! | |
| | |
| | (permalink) | |
| Super Moderator | Quote:
__________________ "I share, thus I am" Jay.slovak Read this! ICD2 Clone Best PIC/DsPIC Bootloader Read my Inchworm ICD2 review! | |
| | |
| | (permalink) |
| Experienced Member | Ok thanks. I would just appreciate it if someone answers my questions. I just came up with another one (don't hate me). Please keep in mind that the pentium 4 will be running linux and that i am not sure how the ICSP will be done now because Jay said i need a programming SW besides the JDM. I thought I will just have the pentium send the PICs the .hex files serially when it is doing ICSP.
__________________ World.......behold........YAN is coming |
| | |