2.11BSD operating system for microcontrollers
It is currently Tue Jan 16, 2018 7:26 pm

All times are UTC

Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Sun Sep 04, 2016 3:01 pm 

Joined: Tue Sep 16, 2014 12:51 pm
Posts: 47
Location: christchurch, new zealand
hi all,
a colleague has produce a minimal 'ascii ICSP' adapter using just a PIC16F1455 that is capable of programming a PIC32 device using pic32prog. but due to low pin count, the 1455 can not control the Vcc supply to the target, and this has shown up a small bug in the bitbang code where it transitioning the target out of programming mode.

i'm hoping someone might lend some suggestions.

at the moment, pic32prog uses the follow code to exit ICSP programming mode:

  /* Clear EJTAGBOOT mode. */
    bitbang_send (a, 1, 1, 5, TAP_SW_ETAP, 0);    /* Send command. */
    bitbang_send (a, 6, 31, 0, 0, 0);             /* TMS 1-1-1-1-1-0 */
    // (force the Chip TAP controller into Run Test/Idle state)

    // not entirely sure the above sequence is correct.
    // see pg 29 of microchip programming docs

    bitbang_ICSP_enable (a, 0);      // ** this currently just waits 50mS then cuts power **

under certain conditions, this leaves the PIC32 in an unresponsive state, even to MCLR being asserted, until power is cycled. my own programming hardware design controls the Vcc supply, so this has never been an issue. but without control over the Vcc supply, it is!

the above sequence, i believe, was pulled in from the code to drive a 4-wire JTAG interface (serge provided it in a skeleton unit). can anyone suggest a 'more correct' alternative. the PIC32 Flash Programming Specification (60001145N) datasheet is rather brief on the matter.

rob :-)

PostPosted: Sun Sep 04, 2016 8:03 pm 

Joined: Mon Nov 12, 2012 1:34 pm
Posts: 1091
Hi Robert,

The old trick used to be some simple gate to turn an unused combination of output pins into a power down signal sometimes with a one-shot to extend the power down duration.

In most cases ALL pins including power must be brought to 0v or very close to it for a while to really get the chip restarted every time.

A VERY similar problem exists for both USB and SD cards. I have yet to teach my RetroBSD system to tolerate and recover from having the SD card removed and reinserted while it is running.

I will be excited to try your code and method out. I do have JTAG running [sort of] to read an SD card and program a Spartan 3E FPGA. The SD card is special formatted, and seems works reliably.

Lots of fun :).


Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:

Powered by phpBB® Forum Software © phpBB Group

BSD Daemon used with permission