Welcome, Guest. Please login or register.

Author Topic: Update PIC on Minimig  (Read 11079 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline boing4000Topic starter

  • Full Member
  • ***
  • Join Date: Apr 2006
  • Posts: 222
    • Show only replies by boing4000
    • http://www.amigademo.de
Update PIC on Minimig
« on: May 11, 2008, 10:12:14 PM »
I used tiny bootloader to update the PIC via RS232 port and null-modem cable.
Problem is: tiny bootloader points out to write the flash memory "100% OK" but after a reset (power off) of minimig the old version is still inside the PIC.

Anyone else did update the PIC via RS232?

Sorry for having that much trouble with everything arround minimig... but I still like it!
 

Offline freqmax

  • Hero Member
  • *****
  • Join Date: Mar 2006
  • Posts: 2179
    • Show only replies by freqmax
Re: Update PIC on Minimig
« Reply #1 on: May 11, 2008, 10:43:36 PM »
Check the RS232 jumper.
 

Offline boing4000Topic starter

  • Full Member
  • ***
  • Join Date: Apr 2006
  • Posts: 222
    • Show only replies by boing4000
    • http://www.amigademo.de
Re: Update PIC on Minimig
« Reply #2 on: May 11, 2008, 10:53:32 PM »
It is set to MCU. Tiny bootloader can also read the PICs output while booting etc.
I also checked the cable, it is working.
 

Offline yaqube

  • Full Member
  • ***
  • Join Date: Feb 2008
  • Posts: 197
    • Show only replies by yaqube
Re: Update PIC on Minimig
« Reply #3 on: May 11, 2008, 11:10:57 PM »
Quote

boing4000 wrote:

Problem is: tiny bootloader points out to write the flash memory "100% OK" but after a reset (power off) of minimig the old version is still inside the PIC.

Anyone else did update the PIC via RS232?


I've updated the flash memory in the PIC many times and never had any problem.
Two possible reasons:
- You are updating the PIC with the old firmware (maybe it seems to be stupid but sometimes it happens).
- The WRTn (have a look at the chapter 19.4 in the PIC18FXX2 datasheet) Write Protect configuration bits are set to zero. If it is the reason the only solution is to erase the whole chip in an external programmer and program the bootloader once again.
BTW: Who has programmed the bootloader in your PIC?
 

Offline boing4000Topic starter

  • Full Member
  • ***
  • Join Date: Apr 2006
  • Posts: 222
    • Show only replies by boing4000
    • http://www.amigademo.de
Re: Update PIC on Minimig
« Reply #4 on: May 11, 2008, 11:19:01 PM »
Thank you yaqube for your detailed answer.
The firmware is downloaded from Dennis website and I also checked the file date several times to be sure.

This PIC was programmed by ACube, if there is a write protection set, it could be done by them and would not be nice if they did!
Is there any way to find out the write protection is set?
Tiny bootloader says the update succeed (100% OK).

Additional... ACube also provides the current firmware for PIC and FPGA on theirs website. It would be illogical that there is a WP set and no customer could use it.

Is it normal that the PIC can not be found by tiny bootloader?
I set it to "UDP send" and "$41 18F 252o/452o" by hand.
If this is wrong, please tell me what settings ware working in your case.
 

Offline Oliver

  • Hero Member
  • *****
  • Join Date: Sep 2005
  • Posts: 803
    • Show only replies by Oliver
Re: Update PIC on Minimig
« Reply #5 on: May 12, 2008, 10:17:34 AM »
Quote
boing4000 wrote:
Is there any way to find out the write protection is set?


Hi,

I've not used tiny bootloader, but if you can read the PIC's program memory, then you should be able to check the configuration bits. If you read the data sheet for your PIC, then you should be able to find exactly where the relevant configuration bit is located. This is likely to not be in the user program memory space, but in configuration program memory (probably above address 30000h).

Hope that helps (sorry, I'm not really sure what your background is)

Oliver
Good good study, day day up!
 

Offline boing4000Topic starter

  • Full Member
  • ***
  • Join Date: Apr 2006
  • Posts: 222
    • Show only replies by boing4000
    • http://www.amigademo.de
Re: Update PIC on Minimig
« Reply #6 on: May 12, 2008, 12:07:43 PM »
Hi Oliver,

I will try to read out the PIC memory. Tiny bootloader can not do that afaik. What program did you use to read and write the PIC via minimigs RS232?

My background is trained electronic technician but a long time without practice in doing such things. Mostly working in IT business, fixing PC, networks and other crap ;-)
I am happy for any info, the rest I will do by myself and share my experience to others.
 

Offline boing4000Topic starter

  • Full Member
  • ***
  • Join Date: Apr 2006
  • Posts: 222
    • Show only replies by boing4000
    • http://www.amigademo.de
Re: Update PIC on Minimig
« Reply #7 on: May 12, 2008, 02:37:26 PM »
OH MAN !! I think ACube did not use any bootloader for the PIC at all!

That may be the reason why "tiny bootloader" tool can not find the PIC. The only output I receive via terminal or anything else is "Minimig Controller build 07-10-2007...".
That could be the explanation for having trouble in updating the PIC.

Is it still possible to reprogramm this PIC with a propper bootloader and then using the RS232 update?
 

Offline koaftder

  • Hero Member
  • *****
  • Join Date: Apr 2004
  • Posts: 2116
    • Show only replies by koaftder
    • http://koft.net
Re: Update PIC on Minimig
« Reply #8 on: May 12, 2008, 02:43:11 PM »
Quote

boing4000 wrote:
Is it still possible to reprogramm this PIC with a propper bootloader and then using the RS232 update?


Yup, pull the pic and use a regular programmer. I use the pic kit 2 programmer from microchip. It's cheap and it actually works flawlessly now thanks to their recent software version.
 

Offline boing4000Topic starter

  • Full Member
  • ***
  • Join Date: Apr 2006
  • Posts: 222
    • Show only replies by boing4000
    • http://www.amigademo.de
Re: Update PIC on Minimig
« Reply #9 on: May 12, 2008, 04:43:54 PM »
Thanks koaftder, I will make it so but first have to build one.
Good to know that there is still a way to reprogram a PIC.
 

Offline Oliver

  • Hero Member
  • *****
  • Join Date: Sep 2005
  • Posts: 803
    • Show only replies by Oliver
Re: Update PIC on Minimig
« Reply #10 on: May 13, 2008, 01:58:39 AM »
Hi Sascha,

I have no experience with the Minimig. I use PICs a lot in my work though. I generally use in circuit serial programming (ICSP) pins, rather than a bootloader. Acube really should have included the bootloader firmware in the PIC.

Just a few notes to explain the difference:

Dedicated PIC programming hardware uses dedicated pins on the PIC to write to the PICs program memory. In some designs (I guess the Minimig is included here), those programming pins on the PIC may not be available to plug in a header for the programming hardware. If using a bootloader, and not ICSP, then three I/O pins are made available for other uses. I'm guessing these pins are used in the Minimig.

A bootloader has two parts:
-PC software: interfaces to the PIC using a UART (RS-232), sends a command for the PIC to initiate a series of table write operations to program memory, and then dumps all the instructions to the PIC.

-PIC firmware: generally a set of instructions that sits in the start of program memory, which waits for the command to commence operation. When started, it buffers the instructions received from the PC, and writes the buffered data to program memory space usig table write commands. The PIC bootloader firmware must first be programmed in the PIC using programming hardware, such as the PIC Kit 2.

There are many programmers available now. At work I use the MPLAB ICD 2 (which is not very robust). At home I use a Willem from Sivava. There are many others available. I like the Willem as a hobby programmer, as it is quite versatile for use with other chips.

Hope that helps.

Oliver
Good good study, day day up!
 

Offline BraindeaD

  • Newbie
  • *
  • Join Date: Apr 2008
  • Posts: 28
    • Show only replies by BraindeaD
Re: Update PIC on Minimig
« Reply #11 on: May 13, 2008, 02:04:27 PM »
Hi all.

I hope that the original author of the thread don't worry about use it to explain my problem with PIC update.
Recently, I've tried to update the PIC. The jumper set in the correct position, null modem cable attach on pc and minimig and, when click on "check pic" button (in tiny bootloader program) I turn on the minimig. In message box of the tiny bootloader appears a message saying the PIC "send a value 'K' <> ... , revise baudspeed when reset" or something like this. I've tried with all the baudspeeds but I canĀ“t update the PIC... what are I'm doing wrong?
Excuse my poor english.
Thanks in advance.
 

Offline boing4000Topic starter

  • Full Member
  • ***
  • Join Date: Apr 2006
  • Posts: 222
    • Show only replies by boing4000
    • http://www.amigademo.de
Re: Update PIC on Minimig
« Reply #12 on: May 13, 2008, 03:26:47 PM »
Hello Oliver,

thank you very much for this amount of information!!

Now I am very sure that ACube did not use a bootloader at all.
The minimig firmware is apparently directly written in the PICs memory starting at $000000.

Problem is how to erase the flash memory and reprogram it with tiny bootloader. My trials until now did not work. I build an adaptive board for the PIC to use minimigs serial connection via MAX232 and the oscillator to make the PIC operating.
Its a kind of WLoader (http://www.voti.nl/wloader/index_1.html) clone of course with adapted pins to 18LF252. Only clock, rx, tx, Vss, Vpp and Vcc is connected.

I connected +5V at MCLR/Vpp and Vcc to make the flash memory writeable. Must Vpp also connected to any serial pin to be clocked/pulsed instead of permanent +5V?

The PIC is responding to tiny bootloaders terminal output but could not be found with "Check PIC" or "Write Flash", it only appears a timeout.

What software can I use to erase the PIC? Maybe tiny bootloader then is able to rewrite it.

Again many questions... It also annoys me to ask and have to make all this steps at all.

Kind regards
 

Offline boing4000Topic starter

  • Full Member
  • ***
  • Join Date: Apr 2006
  • Posts: 222
    • Show only replies by boing4000
    • http://www.amigademo.de
Re: Update PIC on Minimig
« Reply #13 on: May 13, 2008, 03:31:18 PM »
@BraindeaD

I dont mind you, in fact that is exactly the same problem I have. Also this message "send a value 'K' <> ... , revise baudspeed when reset" appears, I think the PIC is sending its startup string and tiny bootloader can not understand it as a valid code.

You do have the same problem, is it also an ACube minimig?
 

Offline BraindeaD

  • Newbie
  • *
  • Join Date: Apr 2008
  • Posts: 28
    • Show only replies by BraindeaD
Re: Update PIC on Minimig
« Reply #14 on: May 13, 2008, 04:57:12 PM »
@Boing:

Not, mine isn't from ACube. Mine was built by a spanish guy that sold me a few months ago. I'm trying to contact to ask him how he flashed the PIC... with or without bootloader... As soon as I know something new about this, I'll put here...