Search found 1246 matches

by Jerry Messina
Sat Aug 22, 2020 10:08 am
Forum: Modules
Topic: Can't get spi to read data
Replies: 19
Views: 2434

Re: Can't get spi to read data

What are the full paths for the two copies of intosc.bas you found and what OS are you running?

According to the installer script, the various library and include files should end up in:
C:\ProgramData\Mecanique\Swordfish
Includes
Library
Plugin
Samples
UserLibrary
by Jerry Messina
Wed Aug 19, 2020 10:16 pm
Forum: Modules
Topic: Can't get spi to read data
Replies: 19
Views: 2434

Re: Can't get spi to read data

Garry, According to my notes, intosc and setalldigital support for the 47J13 was added in SF version 2.2.3.3 and later. There's a missing comment brace '{' around your "These are how I have been..." comment. You'd have to comment out the SetAllDigital call since you commented out the include. You al...
by Jerry Messina
Tue Aug 04, 2020 12:53 pm
Forum: General
Topic: Syncronus serial port
Replies: 2
Views: 712

Re: Syncronus serial port

I've only ever used the synchronous mode to transmit, so I probably can't be much help. To receive I think you have to set either SREN or CREN, and clear them when you want to transmit. There's a better description of using sync mode in other datasheets like the 26K22. If you're the master and you d...
by Jerry Messina
Sun Aug 02, 2020 12:07 pm
Forum: General
Topic: Forum zip files
Replies: 7
Views: 1156

Re: Forum zip files

I've tried a few repair tools, but so far none of them have produced anything remotely usable.
by Jerry Messina
Sat Aug 01, 2020 3:22 pm
Forum: General
Topic: Forum zip files
Replies: 7
Views: 1156

Re: Forum zip files

I see the same issue... when I go to unzip the file I get "data error" so it's not just you.

From the few I've looked at, it only seems to be zip files that are in the forum posts and not ones from the wiki.
by Jerry Messina
Wed Jul 29, 2020 9:42 am
Forum: Modules
Topic: Can't get spi to read data
Replies: 19
Views: 2434

Re: Can't get spi to read data

Ouch! Sorry to hear that Garry. I'm one of the unlucky ones who can work from home, so as of right now I'm still employed. When you get back to it I have one suggestion. In the microchip example driver, they set the SPI control registers to: // SPI_MODE_0 // SMP = 0 'Input data is sampled at the mid...
by Jerry Messina
Sat Jul 25, 2020 2:41 pm
Forum: Modules
Topic: Can't get spi to read data
Replies: 19
Views: 2434

Re: Can't get spi to read data

Looking through the datasheet for the MRF89XA, I think you want a different SPI setup. SPI mode 0 is what's called out in the datasheet, and the ref library from mchip use this mode too. Try this and see what happens. You'll have to adjust the SPI pin #options, IO pin assignments and PPS settings to...
by Jerry Messina
Wed Jul 22, 2020 11:27 pm
Forum: Modules
Topic: Can't get spi to read data
Replies: 19
Views: 2434

Re: Can't get spi to read data

Hi Garry, The write-read sequence is done in the '_transfer()' function: inline function _transfer(b as WREG) as WREG begin_transfer() SSPBuffer = b // send the byte wait_for_transfer() // wait for byte to be sent/received // note: instead of using 'as SSPBUF' function return value, // this forces r...
by Jerry Messina
Fri Jul 17, 2020 3:14 pm
Forum: IDE
Topic: PicKit4 as a programmer in IDE
Replies: 17
Views: 1742

Re: PicKit4 as a programmer in IDE

same here
by Jerry Messina
Fri Jul 17, 2020 1:32 pm
Forum: IDE
Topic: PicKit4 as a programmer in IDE
Replies: 17
Views: 1742

Re: PicKit4 as a programmer in IDE

Then that sounds like it's just the Pickit3 doing that on its own...
I can't think of any way to stop that until you run the program and have it release reset.

Maybe run the commandline programmer at startup and tell it to release reset?
No idea if that would work or not.
by Jerry Messina
Fri Jul 17, 2020 9:14 am
Forum: IDE
Topic: PicKit4 as a programmer in IDE
Replies: 17
Views: 1742

Re: PicKit4 as a programmer in IDE

Haven't really looked for it.

So the problem is if the PC is restarted then the pickit3 will hold the MCLR line low after the PC reboots?
by Jerry Messina
Sat Jul 11, 2020 9:49 am
Forum: Compiler
Topic: Is it possible to store Pin ref in a structure field
Replies: 4
Views: 805

Re: Is it possible to store Pin ref in a structure field

I couldn't really find a clean way to avoid it to make things hardware independant. You can't really make it truly hardware independent. The problem is that the PORTx, LATx, and TRISx registers change offsets depending on the device, so once you compile it for one device another device won't work. ...
by Jerry Messina
Fri Jul 10, 2020 11:46 pm
Forum: Compiler
Topic: Is it possible to store Pin ref in a structure field
Replies: 4
Views: 805

Re: Is it possible to store Pin ref in a structure field

The library module shift.bas shows the definitions and usage of programmable pins... // a pin structure... structure TPin PortAddr as word // PORT addr (input), LAT addr (output) TrisAddr as word // TRIS addr Pin as byte PinMask as byte end structure The SetInput() and SetOutput() routines show how ...
by Jerry Messina
Fri Jul 03, 2020 3:28 pm
Forum: Compiler
Topic: Default Variable Assignment
Replies: 27
Views: 2432

Re: Default Variable Assignment

also, you can't use 'bound()'

Code: Select all

dim bdata() as byte = (10,20,30)

// 'symbol not expected'
dim bsize as byte = bound(bdata)
'sizeof()' works however

EDIT: Thanks to David the fix for bound() and addressof() will be included in the next update (likely 2.2.3.5)
by Jerry Messina
Fri Jul 03, 2020 2:42 pm
Forum: Compiler
Topic: Default Variable Assignment
Replies: 27
Views: 2432

Re: Default Variable Assignment

It seems that one thing you can't do in 2.2.3.4 is initialize a variable using '@' or 'addressof()'

Code: Select all

const cdata() as byte = (1,2,3,4,5,6,7,8)
dim bdata() as byte = (10,20,30)

// both of these produce 'symbol not expected'
dim caddr as longword = @cdata
dim baddr as word = addressof(bdata)