Search found 1469 matches

by Jerry Messina
Fri May 27, 2011 4:03 pm
Forum: Modules
Topic: DS18B20.bas
Replies: 13
Views: 6720

Glad it's all making some sense. Read the datasheet, even if the code has been tested You may find this with a number of libraries. There are so many different chips out there it would be a full-time job just trying to keep up with all of them. While most of them are pretty similar, it seems Mchip j...
by Jerry Messina
Fri May 27, 2011 3:25 pm
Forum: Modules
Topic: DS18B20.bas
Replies: 13
Views: 6720

I'm running it with a different chip (and no sensor), but as long as I specify a port pin that has a pullup and shut off the analog function for that pin, then ds18b20.find() returns false as it should.

If I specify an unused analog or floating pin, then it hangs.
by Jerry Messina
Fri May 27, 2011 1:56 pm
Forum: Modules
Topic: DS18B20.bas
Replies: 13
Views: 6720

Yeh Garry, you mentioned that. I've never used the OW module, but I can see where Find() could get hung up if the hardware's not functioning. I could be wrong (and haven't actually checked this), but the outer 'repeat... until (LastDiscrepancy = 0)' in OW.Search() looks like it'll hang if the pin re...
by Jerry Messina
Fri May 27, 2011 10:30 am
Forum: Modules
Topic: DS18B20.bas
Replies: 13
Views: 6720

On the 4620, pin RE0 is also analog input AN5.

Add a call to SetAllDigital() (found in utils.bas) before the SetPin() call. The default version of SetAllDigital should work ok for this chip from what I can tell.
by Jerry Messina
Wed May 11, 2011 6:28 pm
Forum: User Modules
Topic: SD Card and Sleep or Low Power Mode
Replies: 13
Views: 13297

Very few chips are spec'd such that an input pin can exceed Vcc by more than a few tenths of a volt. Usually there's an input clamp diode on the signal pins to Vcc, so if you shut off Vcc the clamp diode conducts and powers the chip via the input line. How about tri-stating the SPI signals (or setti...
by Jerry Messina
Tue May 10, 2011 5:20 pm
Forum: Compiler
Topic: Too many variables in SE compiler
Replies: 4
Views: 3117

Glad you found it. It seems to calculate the delay values wrongly, in the end I simply calculated the correct value myself and used that as the argument for SetBaudrate. I don't know if it isn't being passed correctly but when you look at the calculated values it seems to be ignoring the Clock setti...
by Jerry Messina
Tue May 10, 2011 2:05 pm
Forum: Compiler
Topic: Too many variables in SE compiler
Replies: 4
Views: 3117

Without seeing the actual code, it's hard to make specific recommendations, but here's some general ones. There's about 25 bytes or so of sytem variables which you can't do much about. If you use interrupts and you have a 'save(0)', you need ~2x that to store the context, and if you use both high an...
by Jerry Messina
Thu May 05, 2011 2:32 pm
Forum: Modules
Topic: new USB v1.4 module (with SF HID bootloader)
Replies: 11
Views: 8132

It seems I violated one of the cardinal rules of software development... don't make any changes after testing (no matter how simple), and found out once again why that rule exists. It seems I added a compile-time check to verify some '#define' settings in the USBCDC file after I had done most of the...
by Jerry Messina
Wed May 04, 2011 6:31 pm
Forum: Modules
Topic: new USB v1.4 module (with SF HID bootloader)
Replies: 11
Views: 8132

I updated the library to v1.4.1 to fix the register initialization issue identified by Graham and RangerBob in the thread http://www.sfcompiler.co.uk/forum/viewtopic.php?t=1470 Normally, I wouldn't post an update so soon, but since this one can be a show stopper if you're using a bootloader, I figur...
by Jerry Messina
Wed May 04, 2011 10:21 am
Forum: Compiler
Topic: Swordfish + Microchip HID Bootloader
Replies: 12
Views: 11000

Dang, Nathan. It sure looks like you've got your bases covered. Of all the junk I have laying around, one thing I don't have is a 4550. I took a look at your latest ClearRegisters.bas, and the Mchip HID bootloader hex file (USB Device - HID - HID Bootloader - C18 - PIC18F4550.hex), and one thing I n...
by Jerry Messina
Tue May 03, 2011 8:35 pm
Forum: Compiler
Topic: 3x3 Matrix
Replies: 2
Views: 2406

Have you seen http://www.sfcompiler.co.uk/wiki/pmwiki.php?n=SwordfishUser.MultiArray ? Something like that could even be extended another dimension if the data is in ram, but unfortunately, this method won't work with const data since you can't initialize an array of const structures. I think you mi...
by Jerry Messina
Tue May 03, 2011 8:15 pm
Forum: Modules
Topic: new USB v1.4 module (with SF HID bootloader)
Replies: 11
Views: 8132

new USB v1.4 module (with SF HID bootloader)

I just posted my updated version of the SF USB library over on Digital-DIY ( http://digital-diy.com/Download-document/87-SF-USBv14-Library.html ) Features include: - support for all current 30 18F USB devices, including: 18F2550, 18F4550, 18F2553, 18F4553, 18F2455, 18F4455, 18F2458, 18F4458, 18F2450...
by Jerry Messina
Tue May 03, 2011 5:59 pm
Forum: Compiler
Topic: Swordfish + Microchip HID Bootloader
Replies: 12
Views: 11000

If it's const string handling, then it's very likely the TBLPTR thing. I just tried the second program you listed, and it works fine using MY USB bootloader and system.bas (but my bootloader clears the TBLPTR registers). I'm using an 18F2553, but otherwise it's the same. Using the standard SF USB li...
by Jerry Messina
Tue May 03, 2011 2:40 pm
Forum: Compiler
Topic: Swordfish + Microchip HID Bootloader
Replies: 12
Views: 11000

Just had a closer look.

If you're building for use with a bootloader that uses low memory, you want to use

Code: Select all

#option org_reset = $1000
instead of

Code: Select all

#option org_program = $1000
That'll move everything up to $1000. Using 'org_program' leaves a 'goto' at location 0
by Jerry Messina
Tue May 03, 2011 1:39 pm
Forum: Compiler
Topic: Swordfish + Microchip HID Bootloader
Replies: 12
Views: 11000

The issue is most likely with the TBLPTR register settings, which is used by SF to read code/const strings. In the 18F, the table ptr is a 24-bit value comprised of three 8-bit registers: TBLPTRU, TBLPTRH, and TBLPTRL. This gives you full access to the 16M address space of the 18F, which you need to...