Jump to content

[SOLVED] Weird problem flashing PICs over MIDI - can't install MIOS to my MB-6582


borfo
 Share

Recommended Posts

I'm trying to program four PIC18f4685's for my MB-6582 from scratch, and I'm having problems...  I seem to have at least sort of successfully flashed the bootloader using a Pickit 2 and MPLAB X, but I can't flash MIOS to the SID over MIDI in MIOS Studio.  I can query the core, and it says the bootloader is running, but whenever I try to flash any .HEX, MIOS Studio times out and says "no response from the core after 16 attempts.

The Core is sending out these messages (which I guess is the upload request) about 120 times a second all the time the SID is powered on...  From other forum posts, it seems this is way too fast - should these messages be sent that often, or is there something wrong with the clock speed on the PIC or something?  Anyone have any thoughts?  Voltages seem fine on the PIC...

[25442.111] f0 00 00 7e 40 00 01 f7
[25442.120] f0 00 00 7e 40 00 01 f7
[25442.128] f0 00 00 7e 40 00 01 f7
[25442.136] f0 00 00 7e 40 00 01 f7
[25442.145] f0 00 00 7e 40 00 01 f7
[25442.153] f0 00 00 7e 40 00 01 f7

 

I've never used MPLAB or flashed a PIC before, so it is possible I didn't flash the PICs correctly...  (although MPLAB said the flashes were successful) Is it possible that flashing the bootloader in an incorrect way in MPLAB could somehow make the PIC's clock go way too fast?

Or, is it possible that the circuit I used to connect the PIC physically to the PICKIT 2 could have been incorrect in a way that could make the clock speed go way too fast?  (there is a pcb with the PICKIT that fits smaller PICS and connects to the PICKIT - I just connected the appropriate pins on that pcb to the pins on my PIC18F4685s via breadboard leads.)

...even thought MIOS Studio reports that the bootloader is running when it queries the core?

 

Is there a complete HEX of the MB-6582 PICs that I could try flashing in MPLAB so I don't have to install MIOS via MIDI?

 

Any help or pointers would be much appreciated. 

Edited by borfo
Link to comment
Share on other sites

Try this prog for flashing with pickit2

http://ww1.microchip.com/downloads/en/DeviceDoc/PICkit%202%20v2.61.00%20Setup%20A.zip.

Or look here

https://www.auelectronics.com/Q3.htm

More Info and Schematic:

ucapps.de/index.html?page=mios_bootstrap_experts.html

 

 

Edited by Noise-Generator
Link to comment
Share on other sites

Thanks - I tried the linux 1.2 version of pk2cmd, and it really seems to be working ok to flash the bootloader to the PIC...  I'm inclined to think it's probably some kind of problem with my MB-6582 core board.  Can anyone confirm that those "f0 00 00 7e 40 00 01 f7" upload request messages coming 120 times per second from the bootloader-flashed PIC is way faster than they should be sent?  ...and if so, does anyone have any idea what might be wrong with my core board to make that happen?  Any ideas what I should be looking at?  All the voltages on the PIC seem right - just below 5v.

Edited by borfo
Link to comment
Share on other sites

I'm reading 4.62v on the 5v rail, 8.83v on the 9v rail and 11.76v on the 12v rail - can anyone confirm whether those numbers are ok?

I just tried flashing the bootloader under a WinXP Virtual Machine, with the same result...  "upload request" messages about 120 times per second, and I can't upload via midi. 

Link to comment
Share on other sites

The voltages seems a bit low, especially the 5v rail, but if your pic work, than it's ok. 

The more I think about your problem, I don't think it's the pic. 

But as I said, I'm not a pro and it's a pity that no one - maybe also don't have an answer - can say some more.

I know how frustrating it is to stuck and start ordering things which might help, but it is like it is.

What you could do by your own is to build a minimal core setup with a breadboard, so you can exclude connection or wiring mistakes and you also learn what does this and that and so on. It's not as hard as it seems to build the core with midi by your own.

 

Edited by Noise-Generator
Link to comment
Share on other sites

I´ve got a theory. 

I think the PIC permanently restarts, thats why you get the upload request. Maybe it´s because of the 4,62v, the PIC can start, but breaks down because it needs constant 5v, so starts again...

I must correct what I said about the upload request first, may there is a upload request every seconds BUT you don´t see this.

The message:[1355.224] f0 00 00 7e 40 00 0f 00 00 f7 just appears by booting, rebooting the PIC. 

 

Link to comment
Share on other sites

Thanks everyone - I was thinking it might be restarting over and over again as well.  The MIDI circuit seems fine (I've tested it in a variety of ways, and I do get communication back and forth from the core including confirmation in MIOS Studio that the bootloader is running).

Power is coming from a C64 PSU, so the 5v rail is regulated within the PSU.  Unfortunate if it's not working properly, since this is the second one I've bought (AC on the first one was broken), and they're not cheap.

I suppose building a minimal core on a breadboard is probably the sensible next step, and then if it is the PSU I guess I'll power it some other way, since the C64 PSUs seem a bit unreliable.

Link to comment
Share on other sites

Argh.  Looks like that's it right there.  I just read directly from the PSU pins and I'm only getting 4v (not sure why I didn't read straight from the PSU before, I guess because the SID board was already wired up and I read 4.6v on the 5v rail there).  Frustrating - this is the second one I've bought.  I guess they're all pretty old and deteriorating at this point...

 

I guess I'll work on another power solution.  Thanks a lot for the help, Noise Generator.

Edited by borfo
Link to comment
Share on other sites

Could I use separate power supplies (a 9vac PSU and a 5vdc PSU) plugged into the same mains power source?  Would that work, or would I have to worry about the possibility that they'd have different ground references (and potentially unexpected voltage differentials) despite being plugged into the same mains power source/ground? 

 

...I've got one C64 psu with working 9vAC and broken 5vDC, and another with working 5vDC and broken 9vAC...  

Edited by borfo
Link to comment
Share on other sites

Yeah, probably should just bite the bullet and do PSU option E.  I've got both 12v and 9v SIDs in this thing, so that'll be two switching regulators, unfortunately.  At this rate I'm going to wind up spending more on power supplies than on the whole device...  haha. 

Link to comment
Share on other sites

You may be able to get away with a linear regulator for the 9V rail, especially if you use a heatsink. (It may also depend on how many SIDs are drawing current on that 9V rail.) Just be aware that the linear reg will generate more heat, which may or may not be an issue.

Link to comment
Share on other sites

Well, would be better he also paid the shipping if he sells broken psus, but maybe you can get some bucks for the broken one.

May you also have seen that there is a polish company selling new c64 psus on ebay (maybe not in usa), but those are really expensive.

It's unusal that they deliever less volts than 5, normally, if the 5v rail is broken (regulator), it delievers more than that and kills everything inside the c64 what needs just 5v. (rip sid)

Thats why c64 users today building "crowbar" protection stuff inside their psus and the community is still fighting each others solutions. As far as I read the last times...

For a c64, a combination of a 9vac and 5v psu is an alternative and usual but I don't want to contradict latigid on, in case of a midibox you generate 20v ac by a magic act of mixing dc and ac, therefore this solution is profen exclusively at this psus.

I do have some c64 psus but try not to use them.

They may have the best noise ratio, Thorsten wrote, but I want to use a Laptop psu with a 12v and usb 5v rail, it's smaller and you get them for 17€.

I can't recommend them at this point, I still did not tested em in mixed mode but 12 for the sid and 5v for the core, works (yeah, why shouldn't...). The question is still what happens by using the 12v for the old sid and transform this rail to 9 for the new sid.

 

 

Link to comment
Share on other sites

Yeah, but better to pay shipping than to pay full price I guess.

Hm...  The laptop PSU option is interesting...  I have a Surface Pro power supply here that puts out 12v and has a USB charging port.  Do you just wire your laptop power supply directly into the 5v and 12v rails?  Or do you run it through linear voltage regulators?  Are laptop power supplies internally regulated?  What PSU are you using?

Link to comment
Share on other sites

This one https://www.ebay.com/itm/120W-Universal-Power-Adapter-for-Notebook-Laptop-In-Car-DC-Charger-EU-Plug-bvg/303062986910?hash=item468ff6309e:g:w-UAAOSw-1ZcZmcc

Pretty much overpowered, but just 1A at the 5v. I also have an old psu which offers 12/5 (0,75/1A), which does more fit the needed power  (could be a lil bit underpowered), it's the psu for an Iomega Jaz drive. At ebay someone is selling them in germany but with shipping 30€

As I wrote, I can't recommend those psus at this point because I did not tested it in all ways for a mixed sid setup, I just powered the core and one sid module.

Yes, I use the 5v directly to feed the core and the 12v for the sid. 

So the only thing what is to do, is to regulate the 12v to 9. Should be also no problem, but can't say this for sure. I read a thread a few days before here, where smashTV, I guess, has written some words about that there are newer voltage regulators out there in case of having more psu options, today and also describes which capacitors can be removed/changed. Can't find this thread again but just looked inside the sid section.

 

Link to comment
Share on other sites

Solved - it was the power supply, and presumably a repeated rebooting of the PICs due to undervoltage.  Got a new C64 PSU and everything worked fine - flashed MIOS and then the SID application...  Thanks for the help everyone.

  • Like 1
Link to comment
Share on other sites

Nice.

I tested the PSUs now in case of noise ratio. I can NOT recommend this cheap China PSU it makes a really loud high noise output but the JAZ PSU doesn't do this, it's pretty damn good, I couldn't recognize that the MbSID is powered with earplugs, just after sending some midi note.

Next I will test the power consumption with 1Core LCD and CS stuff, a slave Core and 4 SIDs.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...