Jump to content

JSynth SID data transfer erases PIC?


ilmenator
 Share

Recommended Posts

Hi all,

yesterday night I finally got my MBSID working. After tweaking around a bit with the menus and on-board control (I have a 2x40 LCD, 10 buttons beneath and one encoder apart from Menu, Edit, CC and Link buttons) I tried JSynth.

After sending some sysex message to the PIC it suddenly kind of died. When I switch it on, I just see the upper row of the LCD completely black, the lower row not displaying anything. I cannot upload any app via sysex anymore, I just get the regular (each sec or so) sysex string from the PIC. Nothing else.

Tonight I will try to reburn the bootstrap loader into the PIC, I hope that the PIC itself hasn't died. But I'm curious: is it possible at all that I destroyed the part of memory where the bootstrap loader is located by sending weird sysex messages via MIDI ???  

Best regards, ilmenator

Link to comment
Share on other sites

Hi Ilmenator,

no, MIOS denies the access to the bootstrap loader space, and I'm very sure that the SysEx upload works properly.

I guess that you've modified the application and didn't take the allocated memory into account. Program code which crosses the 0x7c00 boundary will not be stored in flash memory, you should receive a ...0E xx F7... message during the upload which notifies that you did something 'illegal'. But the 'goto's into this area will not be removed (the part below 0x7c00 will still be executed), therefore it's possible to execute code of the bootstrap loader with improper settings - yes, and in this case parts of the flash memory could be overwritten.

The SID_BANK_Write* routines are at the end of the application, so this must be the reason...

If you need more memory for your modifications, you could remove the string settings defined in cs_menu_cc_table.inc  (saves 2k!)

Best Regards, Thorsten.

Link to comment
Share on other sites

Thanks Thorsten!

Actually, the only modifications I did to the application was that I changed the DIN ports for some of the buttons in cs_menu_io_tables. There still seems to be some problem with one of the buttons, but this is something I will have to dig a bit deeper tonight.

Then I commented out all of the encoder definitions in mios_tables, as I have only one encoder connected. For that one I changed the encoder mode to MIOS_ENC_MODE_DETENTED, because ...DETENTED2 did not work properly with my encoder.

That's about it... I guess that CS_ENABLED 1 in main.asm is correct as long as there is some buttons and encoders connected to the PIC, right?

This thread is probably more and more likely to be moving into the MIOS Programming area  :)

Best regards, ilmenator

Link to comment
Share on other sites

Ok, so just continue with digging. ;-)

In fact the probability to overwrite the bootstrap loader is extreme low (it never happened during my own code development sessions yet), so if you could work out under which circumstances this can be reproduced (detailed description + sources + .syx file), you could help me to improve the stability.

Best Regards, Thorsten.

Link to comment
Share on other sites

Okay,

though I find it not very bright to answer my own posting, here goes:

The PIC was dead as can be. Luckily I have a spare one (thanks go to Microchip  ;) ). I have no idea what it was that I did wrong, but apparently this was the reason behind all my problems. The new PIC is working okay.

Regarding the button problem I mentioned earlier: it's not a problem with the button but with the LEDs on DOUT. The problem I was having is that in CS_MENU_DOUT_TABLE in the cs_menu_io_tables file the pins are counted from left to right; the pdf counts from right to left by naming the pins D0...D7. I got confused over that. So if anybody wants to know:

Pin# 0  =  D7

Pin# 1  =  D6

...

Pin# 7  =  D0

Thanks again, ilmenator

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