Search found 1197 matches

by David Barker
Wed Jan 17, 2007 11:50 am
Forum: Compiler
Topic: Compiler Command Line Options
Replies: 5
Views: 3551

There is no command line support at the moment - there are plans to add this in the future.
by David Barker
Wed Jan 17, 2007 11:06 am
Forum: Compiler
Topic: How do we manage Errros ?
Replies: 2
Views: 2430

If you mean errors like division by zero, this would require a significant code overhead. Probably quite easy if using an interpreted BASIC, but not one that is acceptable for a compiled language like Swordfish.
by David Barker
Thu Jan 11, 2007 4:06 pm
Forum: Compiler
Topic: can we use absolute keyword ? USB support ???
Replies: 6
Views: 5035

> 1- can we use the ABSOLUTE keyword Yes, here are some examples... Structure TSTATUS _byte As Byte C As _byte.0 DC As _byte.1 Z As _byte.2 OV As _byte.3 N As _byte.4 End Structure Dim MyWREG As Byte Absolute $0FE8 Dim STATUSBits As TSTATUS Absolute $0FD8 STATUSBits.C = 0 > Can we force the compiler...
by David Barker
Thu Jan 11, 2007 3:52 pm
Forum: Compiler
Topic: a pascal compiler
Replies: 1
Views: 2261

Yes, I would like to do this as I prefer PASCAL over BASIC. However, there are other priorities at the moment (compiler update and new modules).
by David Barker
Thu Jan 04, 2007 10:12 pm
Forum: IDE
Topic: On another subject
Replies: 4
Views: 4368

> Is there a method to write a particular value anywhere > in Program Mem At the moment, you cannot ORG in Swordfish. Atomic constants types are actually embedded in program memory when they are needed. For example, const RTRN as word = $0012 dim Value as word Value = RTRN will translate to... CLRF ...
by David Barker
Thu Jan 04, 2007 6:59 pm
Forum: IDE
Topic: On another subject
Replies: 4
Views: 4368

> Would it be feasible to support such operations in a > future edition of the compiler? Bytes, Words, LongWords etc are actually represented internally in the compiler as special case structures - which supports the dot notation used. This makes it possible to support declarations such as... dim My...
by David Barker
Fri Dec 29, 2006 10:52 am
Forum: Modules
Topic: Again OneWire-problems
Replies: 8
Views: 6248

> Is this a problem with the library or my program example?

It is a problem with your program example. The DS18S20 does not have the same resolution as an DS18B20. You should use

Code: Select all

USART.Write(DecToStr(TempA),".",DecToStr(TempB), $BA, "C", 13, 10) 
instead.
by David Barker
Wed Dec 20, 2006 9:30 pm
Forum: Compiler
Topic: Problems to identify Interrupts
Replies: 35
Views: 19505

> For my understanding it means tha the bit 0 from register PIR1 > can have the true or the false (first line). It is like 1 and 0 > (second line). Wich is the normaly used way? Good question. It's just a style of coding issue. It's entirely up to you which one you use. I quite like making bits 'boo...
by David Barker
Wed Dec 20, 2006 8:45 pm
Forum: Compiler
Topic: Problems to identify Interrupts
Replies: 35
Views: 19505

> It looks very complex... You could remove the debounce if you like, it would work OK given the amount of time you have to detect a button hold state. Makes it a little easier to follow - just thought it nice to show how easy it is to add debouncing. Anyway, here are the changes... dim ButtonTimeou...
by David Barker
Wed Dec 20, 2006 4:38 pm
Forum: Compiler
Topic: Problems to identify Interrupts
Replies: 35
Views: 19505

> Thanks Dave. Your explanations make it clearer to me now. No problem. Glad it was of some use. > Now I want go back to the beginning of this thread Here is a program which will switch on an LED connected to PORTA.0 if a button connected to PORTB.0 is held for more than (n) milliseconds. The LED is...
by David Barker
Wed Dec 20, 2006 1:43 pm
Forum: Compiler
Topic: Problems to identify Interrupts
Replies: 35
Views: 19505

The first thing to note with Swordfish is that it supports both high and low priority interrupts. If you just declare one interrupt, it will default to high priority. For example, interrupt MyInt() end interrupt enable(MyInt) Calling enable ensures that (a) MyInt is assigned to the correct interrupt...
by David Barker
Fri Dec 15, 2006 2:44 pm
Forum: Compiler
Topic: Just a little bragadosio...
Replies: 2
Views: 3543

For those who would like to use this routine in a function... function access BCDToDec(pBCD as byte) as WREG asm rrcf pBCD, W ; BCD/2 in WREG rrcf WREG, W ; BCD/2/2 in WREG andlw 0x3C ; mask upper nibble as 4 * tens subwf pBCD, F ; BCD = (16 * tens) - (4 * tens) = 12 * tens + ones rrncf WREG, W ; BC...
by David Barker
Fri Dec 15, 2006 1:18 pm
Forum: Compiler
Topic: Problems to identify Interrupts
Replies: 35
Views: 19505

> That is easy to understand. Ok, here is the Swordfish version of what you have given - it's pretty much the same... dim TMR0 as TMR0L.AsWord, RBIF as INTCON.0, TMR0IF as INTCON.2 interrupt MyInterrupt() if TMR0IF = 1 then counter = counter + 1 TMR0 = 96 TMR0IF = 0 elseif RBIF = 1 then counter = co...
by David Barker
Fri Dec 15, 2006 9:08 am
Forum: Compiler
Topic: Problems to identify Interrupts
Replies: 35
Views: 19505

Tim has pretty much explained the strategy. There are a couple of modules which you should look at first on the wiki which would help you http://www.sfcompiler.co.uk/wiki/pmwiki.php?n=SwordfishUser.Modules Check out ISROnChange and Autokey. Also check out ISRTimer. Much of the code is there. If you ...
by David Barker
Tue Dec 12, 2006 9:19 pm
Forum: Wiki Announcements
Topic: New Font Converter
Replies: 0
Views: 4349

New Font Converter

A new BETA font converter plugin is now available from http://www.sfcompiler.co.uk/wiki/pmwiki.php?n=SwordfishUser.UsefulLinks This version will allow you to set a range of ASCII characters to generate. When you have downloaded the executable, double click to install the plugin. From the IDE, just s...