Amiga.org

Amiga computer related discussion => Amiga Hardware Issues and discussion => Topic started by: odin22 on October 20, 2008, 07:07:04 PM

Title: The MiniMig PIC update issue thread
Post by: odin22 on October 20, 2008, 07:07:04 PM
I'm just creating this thread to gather everyone who are having the same issues with updating their PIC in one place in order to gain a better understanding of the problem and perhaps find a solution.

So please - everyone who are experiencing the problems I am about to describe, let yourself be heard.

So here goes:
As a few of you might have read on this board, I have yet to have any luck updating my ACube-built MiniMig v1.1 with the new firmware from Jakub and Dennis - despite using a PIC already containing the TinyBootloader code.

Just this morning I received my second pre-programmed PIC from ACube and much to my dismay, I am experiencing the exact same problems as with the first one. Needless to say, after months of waiting to get this damn thing to work, I didn't know whether to burst into tears or smash the board against the wall, swearing to never indulge myself in an Amiga-related hobby project ever again. I counted to ten and decided to do neither, but instead give it one last chance and see if the community can help me out.

Finding a couple of other posts regarding the same issue neatly sprinkled over the many MiniMig threads on the site (none of them apparantly resolved) gives me meager hope that at least I am not the only one.

To sum up my trials and tribulations, I have followed every description to the letter.

- No jumpers on the Spare I/O or on the row behind the joystick ports.
- Jumper set to MCU and not FPGA.
- PIC seated perfectly (and the right way around)
- No peripherals are connected to the MiniMig (neither mouse nor keyboard)
- Null-Modem cable connected to the serial port of my PC and to the serial port of the MiniMig board.

As I power up the MiniMig, the drive light starts to blink when there is no SD card in the reader, and glows constantly if one is present (I have tried both). Then I start the TinyBootloader app on my PC, make sure it is set to the correct COM port (there is only one) as well as the correct baud rate (115200).
I press the CheckPIC button in the TinyBootloader app and immediately after I press the PGM RESET hardware button on the MiniMig.
Then I get this:

Connected to \\.\COM1 at 115200
  Searching for PIC ...
  pic sending unknown data:  "K" <>  0h=
Check baudrate & Start Write while PIC is not sending serial data (e.g. in reset)
  ERROR!

The "0h=" part of the string varies depending on how many milliseconds I wait between button presses.

To sum up my experience, I have tried:

- 2 different pre-programmed PICs
- 3 different Null-Modem cables (I even hand-soldered one myself to make sure the wiring was correct), all three tested perfectly as Null-Modem in a cable tester borrowed from the IT department at work.
- 3 different computers (all running Windows XP and using TinyBootLoader, v1.9.7)

In addition I have tried with and without an SD card, changing the jumper from 15KHz to 31KHz, and trying it with and without an attached monitor (not that any of those things would make any sense, but I was desperate).

Using the TinyBootloader software I have tried several hundred times with a various timing, prayers, chanting and incantations, but nothing works. I am still treated to the same array of error messages every single time.

The only thing I have left to assume is that I have a broken board. It seems to work just fine while playing the few games it supported properly out of the box, but obviously there is something wrong with it, since I am getting nothing but garbage in return when I try to communicate with the PIC.

I am prepared to handsomely reward anyone able to come up with a solution, because with the poor compatibility achievable without the recent microcontroller update, the board is all but useless to me.

Kind regards,

- Anders
Title: Re: The MiniMig PIC update issue thread
Post by: yaqube on October 20, 2008, 08:11:47 PM
Try this:

Before you click "CheckPIC" or "Write Flash" button press and HOLD the "PGM RESET" switch. Then click the desired button and then release "PGM RESET" switch.

Please tell me if this works for you.
Title: Re: The MiniMig PIC update issue thread
Post by: Andeda on October 20, 2008, 08:27:24 PM
i updated my pic yesterday and i did not touch the PGM reset at all.
first i did power on my minimig then Check pic and shortly after that write flash.
This worked fine and i did not have any problems at all.

My guess is that you have a hardware problem on your hands.
Title: Re: The MiniMig PIC update issue thread
Post by: alexh on October 20, 2008, 09:14:13 PM
Bummer, there must be something that works? No-one near by got a programmer you can borrow?
Title: Re: The MiniMig PIC update issue thread
Post by: beller on October 20, 2008, 09:55:37 PM
It sure seems like the Com: port hardware on the PC is the fault.  You indicate that you set the tinybootloader to 115200.  Have you gone into the Windows settings and pushed the hardware up to 115200 as well?

I had a few problems when I flashed until I reset the hardware and made sure it stayed at the proper baud.
Title: Re: The MiniMig PIC update issue thread
Post by: odin22 on October 20, 2008, 10:33:54 PM
Thank you all for your replies.

@yaqube: I have already tried that trick, but for good measure, I gave it a dozen or so more tries just now doing what you suggested. No luck. Same error as always.

@Andeda: Yeah, that is exactly what I am afraid of. That my hardware is just broken leaving me with no options and approx. £160 worth of paperweight.

@alexh: Unfortunately no. Tried that too. The single hardware engineer I know has never had any experience with PICs. Only Atmels - which are the only programmable ICs he has kits for.

Any additional suggestions? Anything in the description of my preparation of the board strike you as odd? Did I leave something out? I also never really got a clear idea from any of the update tutorials whether to leave the SD card in or out.

Kind regards,

- Anders
Title: Re: The MiniMig PIC update issue thread
Post by: odin22 on October 20, 2008, 10:40:43 PM
Quote

beller wrote:
It sure seems like the Com: port hardware on the PC is the fault.  You indicate that you set the tinybootloader to 115200.  Have you gone into the Windows settings and pushed the hardware up to 115200 as well?


Thanks a lot for that tidbit. Checking the ports in my settings revealed the COM ports were set to 9600 baud. However, after setting them to 115200 I get the exact same results. Both on my workstation and the missus' PC.

Man. I was really getting myself worked up there for a second.

But could it be something related to the interrupts? In modern PCs, IRQs can be shared by many devices at once. Could that have something to say?

Kind regards,

- Anders
Title: Re: The MiniMig PIC update issue thread
Post by: yaqube on October 20, 2008, 10:53:11 PM
If we assume that at least one of the PIC's you have got is programmed with valid bootloader (I hope you have tried both with my suggestions) the serial connection might be faulty.

To verify this please remove the PIC from its socket, connect pin 17 and 18, power on the board without the PIC, run terminal program and check if you get remote echo of typed characters.
Title: Re: The MiniMig PIC update issue thread
Post by: beller on October 20, 2008, 11:59:01 PM
After you reset the com: port to 115200 did you reboot?  You might need to do this to fully configure the port.


Hope this helps!  

Bob
Title: Re: The MiniMig PIC update issue thread
Post by: Darrin on October 21, 2008, 01:23:27 AM
Anders, where do you live?  I'm away in Brazil at the moment, but I'd be happy to let you mail one of your PICs to me and I could fit it to my Minimig and reflash it for you.  If I can reflash it then the Minimig board may be the problem, if I can't then it might be the PCs... or something you're (not) doing.

I'll be home in around 3 weeks.

Edit:  If it does turn out to be the board then I'm sure ACube will fix it/replace it.  Their service & support has been top-notch so far.

Out of interest, do your PCs have "real" serial ports or USB-Serial dongles?
Title: Re: The MiniMig PIC update issue thread
Post by: Andeda on October 21, 2008, 09:21:59 AM
@Odin22

Where do you live? i have a PIC programmer and a minimig at home, So if you send me the PIC i can try to help you.
I live in Finland.
Title: Re: The MiniMig PIC update issue thread
Post by: jensl on October 21, 2008, 02:27:03 PM
It looks like that you have already tried all what was possible.
So there must be something wrong with your IC2 or with the resistors. Maybe the RS232 IC is broken or not correct soldered, or one of the resistors are physicaly broken ore not correct soldered.

What happens, if you are using the Hyperterminal. Can you see the sytemmessage from Dennis firmwaredownload to the xilinx with the original PIC?

MfG
Jens

Where are you located ?

Title: Re: The MiniMig PIC update issue thread
Post by: odin22 on October 21, 2008, 10:01:09 PM
Quote

yaqube wrote:
If we assume that at least one of the PIC's you have got is programmed with valid bootloader (I hope you have tried both with my suggestions) the serial connection might be faulty.


Hi Yaqube. Yeah, I tried both of them.

Quote
To verify this please remove the PIC from its socket, connect pin 17 and 18, power on the board without the PIC, run terminal program and check if you get remote echo of typed characters.


Ok, I might need some more info here. Do I connect the socket holes on the board where pin 17 and 18 were supposed to go? And with what - a paperclip or piece of wire? Won't that short circuit it?
Title: Re: The MiniMig PIC update issue thread
Post by: odin22 on October 21, 2008, 10:10:34 PM
Quote
Maybe the RS232 IC is broken or not correct soldered, or one of the resistors are physicaly broken ore not correct soldered.


That may very well be. There doesn't appear to be anything wrong with the soldering though. But of course that doesn't mean the IC or one of the resisters can't be faulty.

About using Hyperterminal to connect to the board - what is the procedure there and what string should I expect to get returned if succesful?

@Beller: No, actually I didn't reboot either of the systems after changing the baud rate at first. It struck me about thenty minutes after posting though, and unfortunately rebooting the systems didn't have an effect either.
Title: Re: The MiniMig PIC update issue thread
Post by: Darrin on October 21, 2008, 10:16:54 PM
Have you tried screaming "UPDATE YOU USELESS *#&!ING PIECE OF %&$@!" at it?
Title: Re: The MiniMig PIC update issue thread
Post by: odin22 on October 21, 2008, 10:30:07 PM
Again, thanks for the massive rally to help out. You guys are fantastic. You really are. Rarily have I come across a forum as kind and open to newcomers as this.

To all of you who asked about my whereabouts in order to help: Thanks a bunch - I really appreciate the offers and will gladly pay for your trouble. I live in Denmark, and since Andeda has a programmer kit handy and lives "right around the corner" I'm inclined to seize that opportunity if the offer stands.

So how about it, Andeda? Would it be OK if I shipped it up to you? If it's not too much trouble, I'd actually like to send the board along with the PIC just to see if you are able to update it directly before taking the PIC programmer route. Then at least I will know whether my board is truly faulty or not (which would be good to know if I decide to send it back to ACube to fix within warranty afterwards).
Title: Re: The MiniMig PIC update issue thread
Post by: yaqube on October 21, 2008, 10:33:46 PM
Quote

odin22 wrote:

Quote
To verify this please remove the PIC from its socket, connect pin 17 and 18, power on the board without the PIC, run terminal program and check if you get remote echo of typed characters.


Ok, I might need some more info here. Do I connect the socket holes on the board where pin 17 and 18 were supposed to go? And with what - a paperclip or piece of wire? Won't that short circuit it?


Yes, you should connect socket holes for pin 17 and 18 together. I hope you know the order how the pin are numbered. Connect them with thin wire with removed insulation at both ends, it would be great if you could cover the ends with tin (I guess you have said you can solder). Avoid paper clip since it will destroy the socket.

That way you will be able to verify if the components on the Minimig board responsible for bi-directional serial communication are not broken.
Title: Re: The MiniMig PIC update issue thread
Post by: odin22 on October 21, 2008, 10:36:37 PM
Quote

Darrin wrote:
Have you tried screaming "UPDATE YOU USELESS *#&!ING PIECE OF %&$@!" at it?


I did, actually. Remember the chanting and incantations I mentioned? It was right after that. I even threatened it at gunpoint. A soldering gun, but a gun no less. It was loaded, and I had enough flux to circuit-bend it to hell and back.
Title: Re: The MiniMig PIC update issue thread
Post by: Darrin on October 21, 2008, 10:42:44 PM
Quote

odin22 wrote:
Again, thanks for the massive rally to help out. You guys are fantastic. You really are. Rarily have I come across a forum as kind and open to newcomers as this.


This place is the best when it comes to asking for help, plus many of the developers hang out here too.
Title: Re: The MiniMig PIC update issue thread
Post by: Andeda on October 22, 2008, 06:56:41 AM
@odin22

Its ok, i just sent you a PM.
Title: Re: The MiniMig PIC update issue thread
Post by: MiniMorph on October 22, 2008, 09:58:24 AM
Hi there,

I guess this issue is resloved now.

For reference however you can get a very cheap PIC programmer and debugger from microchip now :-

Search for PG164120 on the microchip website.

I know you can get them in the UK for £17 and in the US for
$35.

http://www.microchipdirect.com/productsearch.aspx?Keywords=pg164120

I would not suggest you buying one just to update a PIC on the MiniMig but the option is there and it will allow development and programming on PIC Micros too!
Title: Re: The MiniMig PIC update issue thread
Post by: odin22 on October 22, 2008, 01:52:42 PM
Hi MiniMorph.

The programmer as well as it's low price are certainly intriguing, but it seems to me that this is only half the solution. Since it has no socket on the actual programmer for connecting a PIC, I assume you need an interface board with a compatible pinout for the programmer to communicate with it. Correct?

So where would I find that if I was to look into that solution for future updates?
Title: Re: The MiniMig PIC update issue thread
Post by: Darrin on October 22, 2008, 02:00:10 PM
Quote

odin22 wrote:
Hi MiniMorph.

The programmer as well as it's low price is certainly intriguing, but it seems to me that this is only half the solution. Since it has no socket on the actual programmer for connecting a PIC, I assume you need an interface board with a compatible pinout for the programmer to communicate with it. Correct?

So where would I find that if I was to look into that solution for future updates?


For future updates, I'm hoping that Yaqube's PIC expansion board works out and that somebody puts it into production.  Then you can update your Minimig via a USB memory stick.
Title: Re: The MiniMig PIC update issue thread
Post by: Anding on October 22, 2008, 02:21:53 PM
Quote

Thanks a lot for that tidbit. Checking the ports in my settings revealed the COM ports were set to 9600 baud. However, after setting them to 115200 I get the exact same results. Both on my workstation and the missus' PC.


Do you need to push the baud rate up so high?  I have a little experience with building embedded hardware and find there is always a trade off between coms speed and reliability, especially if a poor connection somewhere is exacerbating the problem.

Would you try and set both sides to 9600 and give it another go?
Title: Re: The MiniMig PIC update issue thread
Post by: odin22 on October 22, 2008, 02:45:23 PM
Hi Anding.

Already tried that. I tried with 9600, 19200, and 57600 baud. No change in outcome.
Title: Re: The MiniMig PIC update issue thread
Post by: yaqube on October 22, 2008, 03:23:16 PM
Windows settings of serial port baud rate does not matter, Tiny Bootloader app overrides these settings. Besides Tiny Bootloader programmed into the PIC works only with 115200 bps using 20 MHz crystal oscillator. Some (the cheapest) USB to RS232 converters are not reliable when working with 115200 bps speed.

Can you see in Hyper Terminal (set rate to 115200, 8N1, no flow control) any messages sent by Minimig after powering it up?
Title: Re: The MiniMig PIC update issue thread
Post by: odin22 on October 22, 2008, 04:15:09 PM
Hey Yaqube.

The serial ports I'm using on all the PCs are onboard ones. No USB adapters.

I just tried Hyper Terminal with the mentioned settings, powered up the board, and got this:

"Ç▪"

I powered up and tried the PGM reset button a few times more, but it keeps returning the same value. I'm not sure what to make of it.
Title: Re: The MiniMig PIC update issue thread
Post by: Darrin on October 22, 2008, 04:27:46 PM
Quote

odin22 wrote:
I just tried Hyper Terminal with the mentioned settings, powered up the board, and got this:

"Ç▪"

I powered up and tried the PGM reset button a few times more, but it keeps returning the same value. I'm not sure what to make of it.


It an updated Commodore logo!  ;-)
Title: Re: The MiniMig PIC update issue thread
Post by: yaqube on October 22, 2008, 04:34:23 PM
You should see the following message:

Minimig Controller
by Dennis van Weeren

Try to change the serial port speed in Hyper Terminal to 57600 or lower, it seems that your PIC is operating with different baud rate (although you should see more strange characters than only these two - while Minimig is booting up it sends a lot of characters on its serial port, had you put an SD-Card with minimig1.bin file?). Please also check what is written on the crystal oscillator next to the PIC socket. Is it 20 MHz?
Title: Re: The MiniMig PIC update issue thread
Post by: yaqube on October 22, 2008, 05:06:02 PM
I have made a small experiment: set my serial port speed to 460800 and I get the "Ç" character as the first after reset. It means that the Minimig transmits 4 times slower than it should.

Maybe you have 4.43MHz crystal oscillator connected to the PIC or the 20MHz one is an overtone oscillator and in your Minimig it oscillate at its fundamantal frequency.

The PIC has programmable bits for oscillator configuration, if they are not programmed to HS mode the oscillator may not be able to operate at its rated frequency. These bits can only be programmed in external programmer.
Title: Re: The MiniMig PIC update issue thread
Post by: odin22 on October 22, 2008, 06:50:46 PM
I checked the print on the crystal and it says "20.0C79" which I am fairly confident means that it should be running at 20Mhz. Printed next to the crystal on the board is "2X". Not sure what to make of that. The only crystal running at 4.43Mhz is the one next to the PGM Reset button and the SD slot. Next to it is printed "1X" on the board.

But if what you are saying is true about the PIC being in charge of the frequency at which the oscillator runs, it looks like I'm {bleep} outta luck.

Regarding the various baud rates, I have now tried everything between 2400 and 115200. All of them return various results in the HyperTerminal window. Some write out multiple lines of one or two characters. Others just write out a few characters. None of it legible text, though. It is all just strings of garbage. No boot text from Dennis.
I have tried both with and without an inserted SD card with a minimig1.bin file on it.

I am sending it off to Finland tomorrow to let Andeda have a look at it. If he finds the same issues as me, we can be pretty sure I just have a faulty board, and when it returns I will send it back to ACube to fix within warranty.
Title: Re: The MiniMig PIC update issue thread
Post by: Anding on October 23, 2008, 01:01:11 AM
Odin22,

Given what you've already tried, if I was in your shoes I might be tempted to send it directly to ACube under warranty now and save time?

Good luck anyway,
Title: Re: The MiniMig PIC update issue thread
Post by: MiniMorph on October 23, 2008, 02:02:26 PM
You could program it with an IC Socket, Five wires and a little berg header.

I can post you those bits.

As others say getting a PIC programmer for this issue is overkill.

I could send you a PICStart2 that is gathering dust round here. I am in the UK however, somebody in your own country can help I guess.

I have been developing using PICs for well over 10 years by the way !
Title: Re: The MiniMig PIC update issue thread
Post by: odin22 on November 01, 2008, 12:09:20 PM
Just a slightly delayed update:

As mentioned, I sent off the board and PIC to Andeda who has been looking into it and (somewhat luckily) he found that it was not me who was going insane: The board is indeed broken. The problem exists somewhere between the RS232 interface and the PIC socket, and because of that he experienced the exact same problems I have been jammering on about. So there. Mystery solved.

Andeda has been kind enough to update the PIC via an external programmer (thanks! - oh, and also thanks to MiniMorph above for offering to send me some bits and pieces for a rudimentary DIY kit, but it looks like I won't be needing it). When the board comes back, I will contact ACube and have it shipped off to them for a fix or exchange.

Thanks to everyone in the thread for their tireless efforts.
Title: Re: The MiniMig PIC update issue thread
Post by: Norway on November 04, 2008, 02:14:23 PM
i have just gotten myself a pic programmer, but what file do i put into my ic. i downloaded tiny bootloader, but there were so many files. as you read im not mutch into this. but i think its fun :-)  :-)  anyone ..?
Title: Re: The MiniMig PIC update issue thread
Post by: Andeda on November 04, 2008, 02:32:33 PM

Hi there

try this: tinybld_18F252_20MHz.HEX



Quote

Norway wrote:
i have just gotten myself a pic programmer, but what file do i put into my ic. i downloaded tiny bootloader, but there were so many files. as you read im not mutch into this. but i think its fun :-)  :-)  anyone ..?