Search found 1197 matches

by David Barker
Wed Dec 27, 2023 10:42 am
Forum: User Modules
Topic: rs-485
Replies: 12
Views: 47597

Re: rs-485

I think Jerry has covered it, but this is what I put on my website some time ago:

http://www.mecanique-web.co.uk/downloads/umc/

the protocol PDF may be of interest
by David Barker
Thu Jun 22, 2023 6:28 am
Forum: General
Topic: PMs not sending
Replies: 1
Views: 2553

Re: PMs not sending

You're messages don't show as sent until someone picks them up.
by David Barker
Thu Jun 22, 2023 6:27 am
Forum: Compiler
Topic: install issue
Replies: 1
Views: 2764

Re: install issue

I have PM'd you.
by David Barker
Mon May 22, 2023 8:20 am
Forum: Compiler
Topic: Interrupts and variable saving
Replies: 13
Views: 12167

Re: Interrupts and variable saving

Thanks Jerry!
by David Barker
Tue Apr 11, 2023 11:37 am
Forum: General
Topic: PIC18F2550 Configuration
Replies: 15
Views: 12901

Re: PIC18F2550 Configuration

Hi The code you have posted looks looks more like PROTON (or POSITRON as it is called now). Some examples include: Declare Xtal = 20 => clock = 20 Dim pinLed PORTB.5 => Dim pinLed As PORTB.5 High OnLed => High(OnLed) pause 50 => delayms(50) also your block and loop constructs: while wend => while [b...
by David Barker
Sun Dec 18, 2022 10:29 am
Forum: Modules
Topic: SD Card, PPS and the 18f26K40
Replies: 17
Views: 10136

Re: SD Card, PPS and the 18f26K40

> ... make a copy of the file and put it into the
> UserLibrary folder. That will override the copy in the Library folder.
> You can make changes to that file instead, and the original will always
> be there untouched.

This is the correct and best way of doing it...
by David Barker
Wed Dec 14, 2022 12:01 pm
Forum: Compiler
Topic: access to characters in string constant
Replies: 10
Views: 9746

Re: access to characters in string constant

Yes, you will have to use a workaround - something like:

Code: Select all

Sub mySub(addr As Word)
End Sub
mySub(@"1234")
or

Code: Select all

Sub mySub(addr As LongWord)
End Sub
mySub(@"1234")
by David Barker
Wed Dec 14, 2022 9:23 am
Forum: Modules
Topic: SOFTWARE UART - ASM ERRORS
Replies: 15
Views: 17276

Re: SOFTWARE UART - ASM ERRORS

Thanks, I can see that now. It looks like the routine isn't being linked in correctly. I can think of a number of fixes but I know Jerry has spent some considerable time on this module so don't want fiddle with his code ;-) I've asked him to take a look. In the meantime, you can add the following to...
by David Barker
Wed Dec 14, 2022 8:59 am
Forum: Compiler
Topic: access to characters in string constant
Replies: 10
Views: 9746

Re: access to characters in string constant

Just for reference, if you want to pass by reference using a 32 bit pointer (rather than 16) use:

Code: Select all

#option large_code_model = true
for example:

Code: Select all

#option large_code_model = true

Const array() As Byte = (1,2,3,4)
Sub mySub(ByRefConst str() As Byte)
End Sub
mySub(array)
by David Barker
Tue Dec 13, 2022 12:24 pm
Forum: Compiler
Topic: access to characters in string constant
Replies: 10
Views: 9746

Re: access to characters in string constant

It hopefully will get fixed but internally, it's a complicated change to the compiler and I certainly don't want to break anything! Purely out of interest, why are you accessing a constant in this way in your code?
by David Barker
Tue Dec 13, 2022 9:32 am
Forum: Modules
Topic: SOFTWARE UART - ASM ERRORS
Replies: 15
Views: 17276

Re: SOFTWARE UART - ASM ERRORS

Can you post a small (as small as possible) piece of main program code that generates the error please
by David Barker
Tue Dec 13, 2022 9:27 am
Forum: Compiler
Topic: access to characters in string constant
Replies: 10
Views: 9746

Re: access to characters in string constant

It's a known issue. You cannot do that with string constants. However, you can use an array of char constants...
by David Barker
Mon Dec 05, 2022 9:36 am
Forum: Compiler
Topic: Subroutine Declaration order?
Replies: 3
Views: 3689

Re: Subroutine Declaration order?

Yes, the help file is a little outdated. Prototype was added early on but after the compiler release.

Thanks for your kind comments on the compiler...

Dave
by David Barker
Sun Dec 04, 2022 11:53 am
Forum: Compiler
Topic: Subroutine Declaration order?
Replies: 3
Views: 3689

Re: Subroutine Declaration order?

Swordfish generally acts like "Turbo Pascal" or "Delphi" when it comes to scope and declaration order so yes, you normally need to declare something before use. You can override this behaviour using "prototype". For example: prototype sub subA() prototype sub subB() sub subA() subB() end sub sub sub...
by David Barker
Tue Nov 15, 2022 8:16 am
Forum: Announcements
Topic: Online Update - 15-11-2022
Replies: 0
Views: 12157

Online Update - 15-11-2022

There is a new compiler update 2.2.3.8 available for registered users. Download: http://www.mecanique-web.co.uk/downloads/swordfish-si.exe and enter your activation key to install. You can view a list of changes here: https://www.sfcompiler.co.uk/wiki/pmwiki.php?n=Swordfish.VersionHistory For the SE...