Bidirectional Data/Clock Switch Question

Status
Not open for further replies.

Hopperito

New Member
I'm trying to route 12vdc and to digital lines to a selected PIC, so I can program individual PICs via ICSP on a bread board without moving the wires around. I figured out how to route the 12vdc after much pain and sufferring, and a lot of help from a thread in General Electronics Chat, but I still need to figure out how to route the clock and data lines. I have some 74LS245s in front of me, but they need the DIR line to determine direction, and I haven't a third line to tell me whether the PICs are reading (programming) or writing (verifying or read mode). Is there another way?
 
Try pulling down the MCLR pins to ground for the deselected PICs. You may keep all RB6 and RB7 connected but it won't matter because they will be in high impedance state.
 
I didn't think of that, but that's a really good idea. I guess I don't need the other projects running while programming one of them. I just have to figure out how to hold the others low while one is active. Thanks for the idea!
 
The PIC MCLR pin has three levels:

1) 0V - device held in reset.

2) 5V - device running.

3) 12/13V - device in programming mode.

For ICSP you have the problem of going from 0V to 13V without the PIC starting running - if MCLR rests at 5V for more than a brief time (the actual value is specified in the datasheet), the clock oscillator will start running. Once the oscillator has started you can't enter programming mode. So for ICSP you generally need the programmer to pull the reset line to 0V before trying to select programming mode.

My personal view of ICSP is that it's only worthwhile for surface mount devices, if the PIC can easily be unplugged you are introducing complications and limitations for very little gain!.
 
Actually, without ICSP, I wouldn't get anything done. It's hard enough moving the clock/data and MCLR/VPP lines from one chip to the next, but my programmer is in a case now, sealed up. I'd prefer to keep it that way. ICSP has been very good to me. I haven't had a single burn failure yet, and I've been working with several different PICs in DIP packages. I guess I've been lucky, and I won't argue with you Nigel, especially after what a fool I made of myself asking for help about transistors.

I never really thought of it until now, but I guess I could look at another way of programming the PIC without ICSP, and duplicate that on the bread board. I added a new power supply that supplies +/-12vdc, +/-5vcd, and even 8vdc, so I have the voltages I need available. All I need is the code on the PC and in the 16F628A on the bread board and communicate with the serial connection I have established for USART experiments. A lot of work though, but it would be fun.
 
Hey Hop, have you considered a boot loader? These are for chips that provide the capability to read and write their own program memory, like 16F818, 16F819, 16F88 (great chip), the 16F870A-16F877A series, and most all of the 18F' devices... It really speeds the devel/debug cycle for me... I just leave Hyperterminal up and running and I pull a jumper and press reset to go into boot loader mode, where I download the hex file through Hyperterminal in seconds, then I replace the jumper and press reset to go back into run mode... The boot loaders I use occupy the first 100h words memory space so my programs 'org' at 0100h (for 16F' devices) or 0200h (for 18F' devices)... It's really pretty neat...

What chips are you experimenting with?

Regards, Mike - K8LH
 
Wow! So that's what a bootloader is for. I have read a little about it, but figured it was a bit too advanced for me yet. I'm reading more about it now.

I mothballed the 16f84a, 16f877, and the 16f628a. I just like the 18F series too much. The 18F devices are just more capable, and cheap enough to have enough of them for all my ideas. I'm mostly working with the 18F452, but I have a dsp I want to play with here, as soon as I build the ability to program it. Uh, the dsp I got from Microchip is the dsPIC30F4011. 48k Flash, 2k RAM, 1K EEPROM, and a bunch of toys and features. I figure that is my next step up, and I can't wait to play with it. I also want to try one that Ken Pergola has mentioned more than once, the 18F4620.
 

I've played with bootloaders as well, VERY useful, particularly if you have an RS232 port on board anyway!. The ones I used all store the bootloader in the very top 256 bytes of memory, so you can start programs at the beginning of memory as usual - although I always added a couple of NOP's and a GOTO at the beginning, and jumped to over the interrupt vector to start.
 
I've played with bootloaders as well, VERY useful, particularly if you have an RS232 port on board anyway!
Alright, I'm hooked. I probably should have looked at this strategy before I experimented with routing the Vpp, etc. This is a really neat idea! Thanks guys.
 

The one I use comes from https://www.microchipc.com, it has the advantage that it doesn't waste any I/O at all, just uses the hardware USART - which you may well already have connected.
 
Thanks Nigel. I grabbed that one for the 452 as well. Now it looks like my Tuesday night/Wednesday will be spent doing R&D. =) Mail man just brought my Maxim sample package today. Yippee!
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…