0

Haven't we been here before?

Posted by Chris on Tuesday, April 21, 2009
I bought my full licences for the Oshonsoft PIC18 simluator today and got the version that has USB support. I was a bit sceptical about spending about £70 on something that has a few questions hanging over it, and since yesterday morning have installed, tried and failed to get some code to compile in about four different compilers.
I really like the Oshon software and decided that, for the cost of a pre-build programmer and test board, it should take a lot of the pain out of USB development.
If the examples are anything to go by.
If they work....

I contacted Vladimir and he sent over the USB-enabled version in a few hours.
I compiled the examples from the Oshonsoft website and prepared the hex files for burning to my fancy new 18F2455 chip(s).

Then it all started to fall apart.
I've never had a ROM error before, nor an EEPROM error when writing to the microchip, but got both of those when trying to write to the 18F2455. I found an updated firmware for my programmer (it's a DIY 149-BC off eBay which is suspect might be a chinese clone, but as I bought it second-hand, I'm not sure where it came from). Anyway, for whatever reason, I couldn't get a the hex file onto the PIC18F.
I tried using fixhex2.exe (which comes bundled with the DIY programmer, v2.5) which apparentl is necessary for a lot of C-compiled code which has been targetted for the 18F series. No difference. I tried lots of different code from different sources, using different compilers.
To be honest, I didn't really know what I was doing, but as long as I managed to build a hex file with no errors (and correct fuse settings of course) I figured it should be good to go. But there was no way I could get the hex file to burn.

I lot of hunting around - it's taken two days in total - and I finally came across Donkey Prog which adds 18F support to the DIY programmers.
It even includes a special version of the software for USB-only programmers (which apparently are nothing short of a nightmare to use and write code for) which has special timing code or something which works with some DIY programmers.
Given that the alternative was to abandon the programmer I'd waited so long for, I decided to give it go.

The software didn't work straight away, but the archive zip came with a firmware update - so using my current app microbrn.exe to copy the dprog.hex file onto a blank 16F628A (phew, lucky I'd bought a few of those instead of the beefier 16F877A variants) I disconnected the programmer, whipped out the PIC that was onboard and replaced it with this new one.

Yay! The software recognised the programmer, dropped by sample hex file onto the 18F2455 chip and validated it a treat. I loaded a new file into Oshonsoft 18F simulator, a simple LED blink program, and burned this to the chip.
It worked a treat! So I now had a way of getting hex files onto my 18F2455 chip!

So just give me a couple of minutes and I'll have some USB up and running, surely...
...not quite so fast there cowboy.
As you can imagine, it was not to be - I took the example code from the Oshonsoft website (which Vladimir assures me works) compiled it and burned it to the 18F2455 chip. When you plug in the USB cable, the output LED comes on, the power LED comes on (so I know that the code is running on the chip and the board is getting 5v from the USB port) but Windows fails to recognise the device.
Not in a "ooooh nearly there" kind of way - when it says something like "Device not recognised". I got nothing. Zero. It didn't even bother to throw up an error.
I swapped the D+ and D- wires (that's a sure way to raise a USB error when working with the FT232RL usb-to-serial chip) and plugged it in again. Still nothing.

I suspect it's something simple, like a fuse setting, or an incorrect oscillator setting (or something equally as daft, like a watchdog timer reset, or the mclr not tied to 5v). But for now, it's off to bed again, still without a working USB-based device.
Here's hoping that tomorrow proves to be a little more fruitful.....

0 Comments

Post a Comment

whos.amung.us

Copyright © 2009 .Nerd Club All rights reserved. Theme by Laptop Geek. | Bloggerized by FalconHive Supported by Blogger Templates.