Jump to content

PIC question! :)


 Share

Recommended Posts

Hi again..

Im aware that the core board is designed to be used with the PIC18F4620 (among others), however I had some 18F46K20's in the lab and I used one instead :-S

The operating voltage is 1.8-3.6V (not 4.2-5.5V) and the clock frequency 64Mhz (not 40MHz).

HOWEVER! MIOS studio still seems to find it (even though the voltage is 1.4V too high), and it even finds the bootloader i uploaded via a "pickit2".

"Operating Systen: MIOS8

Board: MBHP_CORE or similar

Core Family: PIC18F

Bootloader is up & running!"

When I try to upload the MIOS it takes about 10 minutes, then reboots and just says exactly the same in the left window and this in the right:

"mios_v1_9g_pic18f4620.hex contains 12826 bytes (52 blocks).

Range 0x00000000-0x00002fff (12288 bytes) - MIOS8 area

Range 0x00003000-0x000033ff (1024 bytes) - PIC Flash

Range 0x00007c00-0x00007fff (1024 bytes) - PIC Flash

Upload of 13312 bytes completed after 832.14s (0.02 kb/s)"

Does anyone out there know a way of adapting the code to work with this PIC, or is there no other option to splash out on one of the PIC's that are actually recommended?

Thanks guys!

Harry

ps..I have been through most of the troubleshooting sections on ucapps and cant seem to find an error with the circuit..that doesnt mean there isnt one though i guess!

Link to comment
Share on other sites

Hi again guys,

I have purchased a PIC18f4620, and uploaded the bootloader.

I used a pickit2 and uploaded the bootloader hex file.

I then plug the pic into the core board and it finds the bootloader, however when i upload the mios it takes about 15 minutes.

When it finishes it says it uploaded at 0.02kbps and when it reboots and it just finds the bootloader.

Ive checked the output from the optocoupler with an oscilloscope and its finding an output absolutely fine.

Ive also checked the voltages and they seem to be good.

Does anyone have any idea where i could be going wrong?

Thanks very much,

Harry

Link to comment
Share on other sites

As you have a scope, you could check if there's still a signal after the optocoupler, i.e. measure at the PIC UART in pin.

But 90% of all upload problems are caused by incompatible (bad) MIDI interfaces - so which one are you using, which OS etc? The XP compatibility mode of Windows 7 has also been reported to cause problems - or using 32 bit drivers in Win7/64 etc.

S

Link to comment
Share on other sites

Thanks for the reply,

Sorry I have also checked the output from the opto coupler. It seems to outputting a stream of bits at about every second. One bit seems to be about 32us long, which is apparently normal. (http://www.musicfromouterspace.com/analogsynth/midi2cv.htm)

I'm using a E-mu Xmidi 1x1tab.

I've tried the creating a loopback by connecting the cables together and its recognised on MIOS Studio.

I'm running Mac OSX 10.5.8 too.

Do you have any idea as to whether this interface is incompatible, and if so is there a cheap alternative?

I think the problem is probably due to some software error. I'm uploading the bootloader via a Pickit 2, do you know if this could cause any problems?

Look forward to hearing back,

Harry

Link to comment
Share on other sites

There are a few considerations..

You mentioned that your PIC is running at 64 MHZ.. How did you manage that?

What crystal is connected to your PIC, and what are your oscillator settings?

If you really are running at 64 instead of 40 MHZ, then your baudrate will be over 50% too high.

But if that's just what the chip is RATED, then a 10Mhz crystal and X4 PLL will work just fine!

The PICKit2 is a great programmer, especially if you use MPLab, as I do. Most of the MBox crowd have

moved to a GCC toolchain, with a free C compiler too, but I'm still stuck in MPLab myself.

There's a great USB-MIDI interface called the "GM5".. just search this website to learn more.

Good Luck,

LyleHaze

Link to comment
Share on other sites

Hi LyleHaze,

Sorry I forgot to mention, my old chip was running at 64MHz, before I purchased the PIC18F4620. The new one should be running at 40MHz.

Is there any chance you can just run through the steps to upload a hex file onto a pic via mplab and pickit2?

At the moment i'm doing it as follows.

import->hex bootloader

programmer ->program

Then I just unplug the chip, stick it in the core board, turn on my power supply, open up mios studio, select the mios hex file, then click start.

Previously it was running all the way through, rebooting, then only finding the bootloader, but now it gets a MIDI overrun error before its finished.

Oh and also it apparently it should upload in ~9 seconds, mine takes 15 minutes!

Thanks :)

Link to comment
Share on other sites

Well.. I bought my PIC pre-programmed, so I never used the PICKit2 on my original core.

But it's easy to see if you've got it right.

If a PIC has been programmed with the bootloader, when it is powered on, it will send a SysEx request every couple seconds.

The next step is to load MIOS.. after that it will send the SysEx upload request only once on powerup.

Then you load your application.

Actually the MIDI bootloader works GREAT. It is super-convenient to be able to load new code without removing the chip, or even digging your MIDI device out of the rack (or wherever you keep yours) I have done the last few (hundred) rewrites of MBMixer without ever pulling the mixer or opening the case.

The "old" MIOS Studio required Java.. the new one does not. Make sure you know which one you have, and follow all the troubleshooting steps in the WIKI.

You are not the first to have a few problems, there are steps listed there that can help you figure it out.

I'm late for work.

LyleHaze

Oh, MAJOR "I forgot"..

The ID of the chip MUST be set correctly.. and if you don't know what you want, set it to all ZEROS.

I think it defaults to all FFs, and that won't do at all.

Yes, you CAN easily set the ID from PICKit2.. I have changed it for someone else using mine.

Edited by lylehaze
Link to comment
Share on other sites

Thanks LyleHaze,

I've looked into the possible ID problem. When i load up my copy of Pickit 2 Programmer on WinXP i get "User IDs: 00 00 00 00 00 00 00 00".

Is this the same as the the ID you were speaking of previously?

Harry

That sounds right!

Link to comment
Share on other sites

Hello again!

Just had another funfilled day of troubleshooting and have some more feedback.

The following tests were passed with flying colours...

(I have included some notes on the tests I wasnt so sure about)

TEST PC1

TESTMIDI1

TESTMIDI2

TESTOUT1

TESTOUT2

TEST IN1A

TEST IN1B

TEST IN2

TEST IN3:

TEST IN4

TEST IN5 - LED flashes once every second whilst attempting to upload MIOS

TEST IN6: - whilst switch open 5v, whilst closed 0.045V (not 0.1V even tested with two 6N138s!)

TEST IN7:

TEST CORE1

TEST CORE2

TEST CORE3

TEST CORE4

TEST CORE5

TEST CORE6

TEST CORE7

TEST CORE8

TEST CORE9

TEST CORE10

TEST CORE11

TESTSW1 - Tested and failed when I tried to upload the code in each of the following ways:

- Erasing PIC memory and uploading via Pickit2;

- Uploading over bootloader via Pickit2;

- Uploading via MIOS studio over bootstrap.

When the pic was subsequently booted up in the core board i recieved the following message in MIOS Studio.....

No response from MIOS8 or MIOS32 core!

Check MIDI IN/OUT connections!

- As it says on the troubleshooter, I checked pin RD4, but it is constantly grounded.

....The problem may be due to me using a PIC18F4620, as i think the program is written for PIC18F4520

TESTSW2 - already checked the ID field and it is set to USER ID: 00 00 00 00 00 00 00 00

Also...I have tried bypassing the voltage regulating circuit with straight 5V DC..no luck

Ive replaced the optocoupler with a spare..still nothing!

Ive checked the PC for errors in the layout compared to schematic

Ive checked all my soldering joints

Checked the value for all resistors with a multimeter

Checked everything in the circuit for continuity errors and shorts

Tried to upload MIOS via another computer (Win XP instead of OSX 10.5.8)

Is there anyone out there who has the faintest idea of why I still can't upload MIOS, I seemed to have tried everything I can think of!

If this is of any help, 15 minutes seems an awful long time to burn a pic, and as I said earlier, when I try to upload MIOS, when checking the MIDIOUT from the PC with an LED it flashes every second (checked with MIDIMonitor, these are blocks of 306bytes which are repeated 8 times before they change). Could this be a MIDI Interface problem, or is that normal?

Edited by harrywright88
Link to comment
Share on other sites

IT WORKS!!!

used an m-audio midi interface and it uploaded in 8s, i literally jumped out of my seat in joy when "ready." lit up on the screen!

I think the E-MU XMIDI 1x1 Tab needs to be added to the blacklist!

Cheers for everyone who tried to help me

That's great news..

Sometimes the troubleshooting will get frustrating.. but it's nice to see a light at the end of the tunnel.

Have Fun,

LyleHaze

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...