Search found 1264 matches

by Jerry Messina
Tue Apr 20, 2021 12:02 am
Forum: Modules
Topic: I2C SCANNER
Replies: 13
Views: 2267

Re: I2C SCANNER

That's what I get for not trying something before posting it. The for loop For addr = 128 To 254 Step 2 won't work very well since 'addr' is a byte. On the last loop it'll try to increment it: addr = 254 + 2 = 256, which gets truncated to 0 since it's a byte I think the best/clearest code is probabl...
by Jerry Messina
Mon Apr 19, 2021 11:04 pm
Forum: Modules
Topic: I2C SCANNER
Replies: 13
Views: 2267

Re: I2C SCANNER

The INA219 may be ok... once you change the loop to scan more addresses you should see it show up at 0 and $80 (128).
We weren't scanning far enough at first to see it in both places.
by Jerry Messina
Mon Apr 19, 2021 1:46 pm
Forum: Modules
Topic: I2C SCANNER
Replies: 13
Views: 2267

Re: I2C SCANNER

I just noticed this. If you want to scan the entire address range, the 'for' loop needs to be: for addr = 0 to 127 if (I2C2.IsPresent(addr<<1)) then // device found else // not found endif That scans all even address bytes from 0 to 254 ($FE), which covers the 7-bit addresses 0 to 127. Stopping at 1...
by Jerry Messina
Mon Apr 19, 2021 12:30 pm
Forum: Modules
Topic: I2C SCANNER
Replies: 13
Views: 2267

Re: I2C SCANNER

Let's start with the basics... - you do have pull up resistors on SCL and SDA, correct? (10K or less) - I'm sure you just added it later, but you don't need your 'addrs' variable - the I2C module uses full 8-bit addresses, so they always include the R/W bit If the 24LC02 is the only device on the bu...
by Jerry Messina
Wed Apr 07, 2021 12:19 pm
Forum: Modules
Topic: i2c Does not want to show what's on the bus?
Replies: 5
Views: 937

Re: i2c Does not want to show what's on the bus?

It's not really a bug in the original code... it all depends on which device you use. Newer chips tend to have a lot more analog pins, so the risk of running afoul is greater now. I'd change the default to switch them all to digital, but that would break a lot of existing code. Plus, the chip poweri...
by Jerry Messina
Tue Apr 06, 2021 10:40 am
Forum: Modules
Topic: i2c Does not want to show what's on the bus?
Replies: 5
Views: 937

Re: i2c Does not want to show what's on the bus?

No, you didn't do anything stupid. What that example is missing is the IO pin setup to switch pins to digital mode. Many of the IO pins default to analog mode at startup, and if they're in analog mode they always read '0'. For I2C that would look like an ACK. Add this to your '// import libraries' s...
by Jerry Messina
Sun Mar 14, 2021 2:14 pm
Forum: Modules
Topic: SOFTWARE UART - ASM ERRORS
Replies: 9
Views: 1177

Re: SOFTWARE UART - ASM ERRORS

Glad you got it figured out. If you try the FDX module (hwsuart_FD.bas), you'll have to use something other than an 18F14K22. Full-duplex uses two independent TMRx and CCPx peripherals, one for TX and another for RX, and while the 14K22 has two TMR modules (TMR1/TMR3), it only has a single CCP1 peri...
by Jerry Messina
Sat Mar 13, 2021 12:42 pm
Forum: Modules
Topic: SOFTWARE UART - ASM ERRORS
Replies: 9
Views: 1177

Re: SOFTWARE UART - ASM ERRORS

Lee - Could you post all of the actual code you're using? What you posted doesn't compile as is. Also, just so you know - in general, software UARTs are usually ok for sending data but have multiple issues reading data. Since there's no hardware involved, your code must be ready to receive a byte (i...
by Jerry Messina
Mon Mar 01, 2021 4:39 am
Forum: General
Topic: interested in new device support?
Replies: 12
Views: 2677

Re: interested in new device support?

Datasheets now rival War And Peace.

I'm not looking for anything specific, just how things go as you try various functions.
The new devices have some very different layouts.
by Jerry Messina
Tue Feb 23, 2021 1:59 pm
Forum: Compiler
Topic: Vector Interrupts
Replies: 9
Views: 2404

Re: Vector Interrupts

Well, almost a year later and I finally got around to doing an article on using vectored interrupts!

The new IVT V2.0 module in the latest update makes this much easier to setup.
There are also a few more examples and even versions of ISRRX and ISRTimer that support using them.
by Jerry Messina
Mon Feb 22, 2021 8:09 pm
Forum: Wiki Announcements
Topic: New Article: Using Vectored Interrupts with Swordfish
Replies: 1
Views: 10402

New Article: Using Vectored Interrupts with Swordfish

There's a new article describing how to use Vectored Interrupts with SF and the IVT.bas module.

This goes along with the IVT V2.0 module in the latest library update.
by Jerry Messina
Mon Feb 22, 2021 8:03 pm
Forum: Announcements
Topic: Swordfish Library and Device File Update 2_22_2021
Replies: 0
Views: 1610

Swordfish Library and Device File Update 2_22_2021

Swordfish Library and Device File Update 2_22_2021 This update for V2.2.3.6 has various device file and library updates, including: K83 device file updates to fix interrupt definitions updated IVT module for improved vectored interrupt support (IVT.bas V2.0) versions of ISRRX and ISRTimer for vector...
by Jerry Messina
Sat Feb 20, 2021 11:52 am
Forum: General
Topic: interested in new device support?
Replies: 12
Views: 2677

Re: interested in new device support?

Great, Lee. The Q41 has a lot of features to play around with. Sounds like you have all you'll need if your chips ever make the Great Escape!. It'd be good to get some feedback once you're all setup... there's bound to be some things I've missed along the way. I have some library updates that I'll b...
by Jerry Messina
Tue Feb 02, 2021 10:57 am
Forum: Modules
Topic: SOFTWARE UART - ASM ERRORS
Replies: 9
Views: 1177

Re: SOFTWARE UART - ASM ERRORS

I think I may have "cried wolf" a bit hastily! I don't think you did. Your old PC probably has an older version of the compiler. The SUART.bas in SF VERSION 2.2.3.6 - ICC 1.2.0.7 will show the error. I tried to simplify some of the include files and left out some stuff. Sorry! The attached file sho...
by Jerry Messina
Wed Jan 13, 2021 5:40 pm
Forum: General
Topic: interested in new device support?
Replies: 12
Views: 2677

Re: interested in new device support?

Ruben,

If you go to "quick links" | "Members", David Barker you should be able to send a PM or email to David from there.

I don't have a phone number.