AZConcept

Tag: Problemes Pic Astro

Pic Astro and Pic Programming

by on Nov.26, 2012, under Astronomy, Microcontrôleurs

I had some issues with « PicAstro ».

Suddenly no response on PC side (Serial) nor on motor side.
The beast is dead.

So, first I checked what’s going on at microcontroller level. No live signals, no response on any Input, simply the clock was running, nothing else.

So I decide to verify if I can reprogram the bootloader.
But I have no PIC programmer.
No problem I will built a cheap one based on JDM (on internet) but reduced to the strict minimum.

The programmer is built, but the PIC does not answer, dead.

I buy a new PIC (waiting is horrible in these cases) and try. It works.
I put the brand new programmed PIC in the socket, start the PicAstro and I am able to connect with “Tinybld” and so to flash the application hex file.

Flashing is successful and then surprise, the DE motor runs as expected, but the AD motor does not.
It seems there is a roughly 1 Hz pulse in the background and when I make the motor turning with the PAD the motion is not smooth at all and even there is no torque.

For me it is clear, suspect number one is the L298 driver …
I decide to just modify the Logic to Power interconnection to use the (supposed) sane DE circuit but with the AD signals.
Same result, so error does not come from the Motor Driver circuit.

I test of all the signals with the scope and I find out that when I test the RB5 output the PIC stops …
Why, RB5 is supposed to be an output, why does it influence the PIC software?

After multiple other checks (is my programmer ok ???) I discovered that the new PIC comes with the LVP (Low Voltage Programming) bit set which has as a consequence that RB5 cannot be used as general purpose I/O …

So I decided to modify the programmer in order to program the PIC in High Voltage Mode so that I can overwrite the LVP bit.

After that everything works and I even discovered that the original PIC was not dead, simply the LVP bit was already reset so not recognized by the LVP programmer.

Moral of the Story … Do not trust to LVP, go directly to HVP so everything can be done without restriction and … frustration

See programmer sketch hereunder.

PicPgm


Kicad:
See Kicad 3D view:
PIC High Voltage Programmer
Complete Kicad Files:
PicProg

Leave a Comment :, , , , , , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Blogroll

A few highly recommended websites...