borfo

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

22 posts in this topic

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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

I can´t confirm this, because I don´t have this board but the Cores should operate the same way.

Normally this happens 1 time in a few seconds.

Maybe it´s a wrong component? Have you proove the values? I dunno, still learning, every day.

 

Share this post


Link to post
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. 

Share this post


Link to post
Share on other sites

Posted (edited)

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

Share this post


Link to post
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. 

 

Share this post


Link to post
Share on other sites

Could be your MIDI interface (check the blacklist on the wiki? Do you have the MIDI circuit installed, including the optocoupler chips? Photos?

Share this post


Link to post
Share on other sites

4.6V might be a little low. How are you getting that 5V rail, pretty sure a 7805 should do better than that.

If you can, can’t hurt to try different cables, interface, computer, etc.

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Posted (edited)

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

Share this post


Link to post
Share on other sites

Posted (edited)

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

Share this post


Link to post
Share on other sites

You should never connect two power supplies together. If you really need to use two different rails, then the DC sides must be common (connected together) at 0V.

I recommend buying the RECOM switching +5V Vreg and using a decent single-rail 9V PSU. @jaytee was the last to do it I think.

Share this post


Link to post
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. 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Just got in touch with the person who sold me this PSU - they're going to send me another for shipping cost, so hopefully third time lucky!  haha.  If that doesn't work, I'll go the PSU option E route.

Share this post


Link to post
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.

 

 

Share this post


Link to post
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?

Share this post


Link to post
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.

 

Share this post


Link to post
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.

1 person likes this

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now