Frustration

Status
Not open for further replies.

YAN-1

New 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.
 
In-circuit programming (ICSP) is very usefull feature. It allows you to program PIC easily in circuit (as you said), by controlling RB7, RB6, MCLR (+GND and maybe VDD). You only need to know the sequence of activation if you made your own programmer! (I mean totally new design). If you build let's say JDM, then there is no reason to learn how it works, you just plug it in and press program button.

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!
 
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)
 
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?
 
You are a little confused with this...

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...
 
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 ). And this JDM will take care of the required voltage sequences of the master clear, RB6, and RB7 pins, right? and it is connected via the serial port to the CPU, right?
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'.
 
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
 
ok...
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.
 
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.
 
No it doesn't work that way... You always need additional SW running on that PC. But there are bootloaders that are using standart Hyperterminal to send HEX files (Microchips own bootloader). So you just program that PIC under windows, and later use Linuxs terminal to send new HEX files.
 
Thanks Jay. I just saw your reply. I will read about this as much as I can and let you know when I have more questions . But please clarify the programming software that i will need becasue, as i mentioned, the cpu is running under linux and i am not sure how this will be done. can i assemble the programs i will need, save the .hex files on the hard disk, and then send them to the PICs in the ICSP mode or do i need a program like mplab installed on the motherboard hard disk? thanks.
 
Problem is there is no IDE for PICs that runs under linux. I recomend you to stick to ICSP mode for a while (bootloader requires special modification of your programs). There are many programmers available:
Serial based: JDM with IC-prog Software
Paralel based: "Schaifer" + Ic-prog or Nigels WinPicPro
My STICKY has all the links you need.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…