USB DEVICE CONTROL in NUT&VOLTS by A.Enzmann

This is the place for any magazine-related discussions that don't fit in any of the column discussion boards below.
xander
Posts: 3
Joined: Fri Aug 18, 2006 4:44 am
Contact:

Post by xander » Fri Aug 18, 2006 6:00 am

A couple of minor things.

The cap on pin 2 of the MAX232 in the schematic was placed correctly. The scan of a datasheet simply shows another way to place it. Basically pin 2 is the output of a voltage doubler and needs to be on the positive side of a cap to hold energy. You can have negative side at ground or you can have it at Vdd. Only difference is the amount of voltage across the cap (and it will take slightly longer to charge the cap up to full voltage).

The warnings about the stack are probably due to changes in SDCC from the one originally used in the article. The argument "-t 128" is probably what's causing the problem (delete from GPLINK_FLAGS).

Xander

Rudy E
Posts: 6
Joined: Wed Aug 16, 2006 12:52 am
Contact:

Post by Rudy E » Fri Aug 18, 2006 9:06 am

Hi Xander,

I managed to compile a hex file that really works, I tried it 5 times before I believed it :grin:, it is about 4kb bigger than yours but it works. Now I have to see what I changed on the project because besides banging my head the last few days like copperclad did, I swapped around a few lib, inc, etc… files from old to new version and visa versa.

The file was made with the old SDCC version 2.5.6, compiling the source with the new 2.6 version gave me a smaller file with the stack problem you mentioned but that one doesn't work. The pc simply doesn’t detect the pic.

I'm working with a 16Mhz crystal and had to change the config byte 1L to 0x23 instead of 0x3C written in the source.

xander
Posts: 3
Joined: Fri Aug 18, 2006 4:44 am
Contact:

Post by xander » Fri Aug 18, 2006 9:46 am

The 4K difference in size is most likely a difference in DEBUG_PRINT being on or off (top of usb.h). If you don't have any serial I/O in the hex file, it is much smaller.

Getting rid of the "-t 128" in the makefile should cure the stack warning when linking a version built with 2.6. But as I mentioned before, the .lib files that come with 2.6 seem to need to be rebuilt to get the USB code to work.

Is there a good place to post the library files that go with SDCC 2.6?

Xander

Rudy E
Posts: 6
Joined: Wed Aug 16, 2006 12:52 am
Contact:

Post by Rudy E » Fri Aug 18, 2006 11:15 am

The DEBUG_PRINT is off because I didn't install the serial output. I trusted the source to be working source and it did. Thank you for your article and the quick response to our problem, in all the hurry I forgot to mention this.

I don't have Cygwin installed so I can't rebuild the libs, I downloaded a nightly snapshot, copied the libs and now it compiles but like before the compilation doesn't work :sad: The file is smaller, maybe they tried to optimize the compiler to create better source??

I think I'll stay with the version that works, that’s the trouble with these free compilers, compatibility with older versions!!!

I don’t know a good place to put new download file, if you want I could place them on my site but I can’t guarantee that they will be there for ever.

Post Reply

Who is online

Users browsing this forum: Mike6158 and 18 guests