Home
Prox / RFID
Verichips
Ladder Logic
[interfacing] †
Tube Joints
Key Code From Photo
SolveSpace (3d CAD)
SketchFlat (2d CAD)
Photographs
Miscellany
Resume / Consulting
Contact Me

LDmicro Forum - Cable pinout & bootloader for PIC

(you are viewing a thread; or go back to list of threads)

Cable pinout & bootloader for PIC (by Evan Raftery)
Does anyone have a cable pinout diagram hexloader combination that will work via a Max232 to PIC

Will a null modem cable work for it & are there any crossvers on cable required for downloading program to PIC.

At present on the board only pins 2,3 & 5 are connected on a 9pin D sub.
Mon Nov 23 2009, 17:22:56
(no subject) (by Jonathan Westhues)
If you use a female DB-9, then your PIC should transmit on 2 (from PIC to PC) and receive on 3 (from PC to PIC). You would then use a straight-through cable.

If you use a male DB-9, then the pinout is reversed, and you would use a null modem cable.

Check the documentation of whatever bootloader you are using to ensure that no extra control signals are required. But that's unlikely.

And consider abandoning RS-232 entirely, since it's pretty well obsolete. A part like the FT232R lets you plug in over USB, and still show up as a serial port on the PC. So all existing software will work.
Tue Nov 24 2009, 02:02:21
(no subject) (by Evan Raftery)
Thank you very much for clarifying that.

Will implement the FT232R next time. Has the added advantage according to its data sheet of having an onboard oscillator to replace the crystral on PCB.
Sun Nov 29 2009, 02:01:08
(no subject) (by Jonathan Westhues)
True, but be careful: the FT232R's oscillator output shuts down when USB isn't active. So if the host puts it into suspend--or if you're just running off some random +5V supply and not plugged into a computer at all--then the oscillator goes away.
Sun Nov 29 2009, 02:19:36
(no subject) (by Samukelo Shezi)
Hi Jonathan

Can you please kindly clarify this to me:

1) The USB or RS232. Can they be used to download a program to a (bootloaded - I understand you have to do this the old fashion way- the programmer) chip? The reason I ask is because I see the ICSP port is, in many circuits, shown as a seperate entity from the aforementioned ports. Does that mean USB/RS232 are only used while the program is already resident in the chip just to communicate with other devices, and not to download the program the way I thought ICSP works?

2) While I understand that bootloaders are not the same, is there not a standard, basic bootloader that can be used for, say, the 16F628 and the 16F877. At this stage I am not interested in learning to write a bootloader.

Once again thanks for evry little sacrifice you've made, and are still making to share your incredible knowledge and wisdom!
Thu Nov 11 2010, 12:06:19
(no subject) (by Jonathan Westhues)
(1) Many microcontrollers can "self-program". This means that code running inside the micro can change the micro's program memory. So if a bootloader is written into the micro, then that bootloader can receive a new program over any channel (for example, the UART, or some bit-banged protocol on a GPIO, or SPI, or ...) and write it into the program flash. The protocol can be whatever the author of the bootrom chooses.

Or, the microcontroller can accept a program on the programming pins; for a PIC, for example, on PGD, PGC, and nMCLR. Logic inside the micro will write the program flash with the data presented on those pins, according to a protocol defined by the manufacturer. This lets you write the program memory with any program that you want, regardless of the memory's initial state.

So it's always possible to program a PIC or AVR with the in-circuit programming pins. If a bootloader is installed in the PIC or AVR, then it's also possible to program the part with the bootloader, for example over serial or USB.

But, you need some way to get the bootloader into the chip in the first place. You could use the in-circuit programming pins, or you could use a programmer with a socket before the chip is soldered down (which uses those same programming pins).

Likewise, if the bootloader somehow gets screwed up (for example, by overwriting itself with garbage, due to a bug in the bootloader or a user error), then the bootloader will no longer be usable. But the part can still be salvaged by reloading the bootloader, using the in-circuit programming pins.

(2) I'm afraid that I haven't used any PIC or AVR bootloaders, but I do know that many are available for free. Perhaps someone who has experience can say what they're using.
Thu Nov 11 2010, 22:30:03
(no subject) (by Samukelo Shezi)
Thank you very much Jonathan!
Fri Nov 12 2010, 15:08:32
(no subject) (by Samukelo Shezi)
Thanks Simon. I think I like that TinyPIC very much! :-)
Fri Nov 19 2010, 14:10:09
Post a reply to this comment:
Your Name:
Your Email:
Subject:
(no HTML tags; use plain text, and hit Enter for a line break)
Attached file (if you want, 5 MB max):