Jump to content

MBHP USB PIC issues


Urgon
 Share

Recommended Posts

AVE...

For various reasons I decided to make USB MIDI interface based on PIC18F4550. I designed board for it, programmed the uC and plugged it in. And it didn't work. I checked out the hardware part and it's good, then I checked programming part, and found few odd things. I have a couple of questions:

1. Why firmware sets odd configuration bits for microcontroller? For example external clock, instead of HS oscillator.

2. What are proper configuration bits?

3. Why you had to use GPASM and SDCC? MPLAB IDE is evil or something?

4. Does anyone know, how to set SDCC, GPASM and MinGW32 on Windows 7 x64, so it won't fail compilation every time? I set the paths correctly.

5. Could someone recompile the firmware for me so it could work with 4 IIC modules(when are connected)? Or make it MPLAB-compatible so I could use proper toolchain?

6. Could someone make simple code to test the USB comunication or post a link to working code for that test?

For programming I'm using PICKit3 and MPLAB IDE v8.87(MPLAB X doesn't work too well with Win7), and PIC18F4550 Rev. 7.

No, I don't want to buy GM-5 or use STM32 or LPC17 cores. I spent too much time and money on this already...

Link to comment
Share on other sites

Hi,

1. Why firmware sets odd configuration bits for microcontroller? For example external clock, instead of HS oscillator.

The HS oscillator is used.

The firmware doesn't set the configuration since it's assumed that it will be uploaded via the Pdfsusb tool as described under Installation.

2. What are proper configuration bits?

The binary of the Microchip USB bootloader contains the configuration flags, which you could take over if you want to program the firmware without this bootloader.

3. Why you had to use GPASM and SDCC? MPLAB IDE is evil or something?

There are various reasons.

I developed the firmware 2005 (so: 7 years ago!) under Linux. The MPLAB IDE was only running under Windows, and my computer was too slow to run it in a wine emulation (at this point of time).

Later I switched to MacOS - same situation.

The reason why SDCC is used: in order to define the descriptors properly without zero-padding between the "db" statements, I was forced to use a C compiler.

The Microchip C compiler is not free, and I don't want that people have to spend money just to re-compile my firmware.

4. Does anyone know, how to set SDCC, GPASM and MinGW32 on Windows 7 x64, so it won't fail compilation every time? I set the paths correctly.

What do you mean with "fail" exactly?

Note that SDCC 2.8.0 has to be used. The GPUTILS version doesn't matter.

5. Could someone recompile the firmware for me so it could work with 4 IIC modules(when are connected)? Or make it MPLAB-compatible so I could use proper toolchain?

"Proper toolchain"? Do you really want to buy an expensive compiler just to compile a small piece of my firmware?

However, here the binary for 4 IIC modules: http://www.ucapps.de/mbhp/mbhp_usb_pic_v1_1_4iic.zip

6. Could someone make simple code to test the USB comunication or post a link to working code for that test?

It really seems that you haven't read my installation instructions...

By using the Microchip USB bootloader you've a perfect way to test the USB communication with an independent firmware.

Best Regards, Thorsten.

Link to comment
Share on other sites

AVE...

I made a very, very stupid mistake and didn't program the uC at all. Mea maxima culpa. Even though it looked as if I programmed it. The first program code doesn't contain config bits, so I took them from bootloader. Even though uC is programmed properly this time, it doesn't seem to work. No USB communication at all. I'll recheck the hardware and try it with different computer running different OS...

Bootloader doesn't work. And even if it worked, Windows won't install those drivers for some reason. They are too old or something. I had such driver issues with other hardware too. That's why I didn't follow your installation instructions...

I had issues with compilation related to paths and missing files. I solved most of them but still was unable to successfully compile sources, though it made a hex file. Also I used wrong version of SDCC...

I solved the problem finally - IC socket had connection problems. Device works now...

I attached a zip containing my board design made in DipTrace, also two views of top and bottom side, and 300dpi black and white print version for thermal artwork method. Hope it'll help someone...

MBHP-PIC-USB-IIC.zip

Edited by Urgon
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...