Search found 1246 matches

by Jerry Messina
Sat May 02, 2009 10:02 pm
Forum: Compiler
Topic: High/low priortiy interrupts question
Replies: 13
Views: 5563

Glad to hear things are working out for you. I try and avoid save(0) if I can get away with it (and if you're really careful in what you do in the intr handler, you usually can). As far as events go, as I said before, events are an indirect function call. With the pic architecture, that amount of ov...
by Jerry Messina
Sat May 02, 2009 9:14 am
Forum: Compiler
Topic: High/low priortiy interrupts question
Replies: 13
Views: 5563

If I remember correctly, the save(0)/restore block takes about 160 cycles to execute.
by Jerry Messina
Fri May 01, 2009 10:42 am
Forum: Compiler
Topic: High/low priortiy interrupts question
Replies: 13
Views: 5563

Take a look at the asm listing. Depending on how you've declared the variables, you'll probably find that the multiply is using PRODH:PRODL registers. But that is probably the least of your issues. If the comments are correct, it looks like you've got the timer intr set to generate 20 ticks/msec, wh...
by Jerry Messina
Thu Apr 30, 2009 9:58 am
Forum: Compiler
Topic: High/low priortiy interrupts question
Replies: 13
Views: 5563

Nothing obvious jumps out at me, but then again I haven't even finished my first cup of coffee yet. Some general things to check are... - A lot of pic's have an errata for the priority saving mechanism. Try using #option ISR_SHADOW = false and see if this helps. - Make sure you're setting the IPRx p...
by Jerry Messina
Wed Apr 01, 2009 11:34 pm
Forum: Compiler
Topic: code generated for setting a port bit
Replies: 6
Views: 2785

That's one solution. I guess I just wasn't expecting the result I got at first.
It still doesn't seem right to me.

Thanks, octal.

Jerry
by Jerry Messina
Wed Apr 01, 2009 5:00 pm
Forum: Compiler
Topic: code generated for setting a port bit
Replies: 6
Views: 2785

As I stated, if 'b' is declared as a bit, then the code works as expected... dim b as bit PORTA.0 = b generates ?I000003_F000_000024_M000000 ; L#MK PORTA.0 = B BTFSC M0_U01,0,0 BSF LATA,0,0 BTFSS M0_U01,0,0 BCF LATA,0,0 and there are no extra writes to the LAT. I was expecting similar code to be gen...
by Jerry Messina
Wed Apr 01, 2009 3:41 pm
Forum: Compiler
Topic: code generated for setting a port bit
Replies: 6
Views: 2785

Always READ FROM PORTx registers and write to LATx registers (this let you also avoid Read/Write/Modify behaviour of PIC ports) !!! SF (at least 2.1.0.1) is nice enough to take care of that automatically for you... if you look at the generated code, you'll see that writing to a "port" actually writ...
by Jerry Messina
Wed Apr 01, 2009 11:26 am
Forum: Compiler
Topic: code generated for setting a port bit
Replies: 6
Views: 2785

code generated for setting a port bit

I just noticed that if I use dim b as byte PORTA.0 = b the compiler generates BSF LATA,0,0 BTFSS M1_U08,0,0 BCF LATA,0,0 which results in the port pin always being set high first, which wreaks havoc with my hardware. (It doesn't do this if 'b' is declared as a 'bit'). I've had to result to using if ...
by Jerry Messina
Wed Mar 11, 2009 10:39 am
Forum: Compiler
Topic: help with #option and defining bits
Replies: 1
Views: 1534

help with #option and defining bits

I've seen the following syntax in a few modules #option SSPI_SCK = PORTC.3 dim FSCK as SSPI_SCK.[email protected] This seems to define FSCK as a 'bit', whereas if I do #option SSPI_SCK = PORTC.3 dim FSCK as SSPI_SCK FSCK ends up being a 'byte', which isn't what I want. I can't seem to find this explained an...
by Jerry Messina
Sat Feb 28, 2009 12:47 pm
Forum: Compiler
Topic: New updates coming?
Replies: 5
Views: 3209

David,

There's a couple of threads over in the IDE forum about this and working with mplab.
See http://www.sfcompiler.co.uk/forum/viewtopic.php?t=835 for example

Jerry
by Jerry Messina
Fri Feb 13, 2009 12:27 pm
Forum: IDE
Topic: MPLAB 8.10 problem
Replies: 4
Views: 4281

you're not alone. see http://www.sfcompiler.co.uk/forum/viewtopic.php?t=835

While it works, it's pretty ugly.

I've given up trying to build under mplab. I use the SF ide to compile,
and just import the cof file into mplab for debugging. A bit of a pain,
but workable.

Jerry
by Jerry Messina
Fri Feb 13, 2009 12:02 pm
Forum: Compiler
Topic: syntax for 'prototype' declaration
Replies: 2
Views: 1905

Thanks, octal. That syntax worked out much better. However, your warning about "USE AT YOUR OWN RISK" is right. If you declare a function with the 'prototype' keyword, the code generator screws up, causing any 'inline' routines accessed by that function to be expanded incorrectly. Taking a look at t...
by Jerry Messina
Thu Feb 12, 2009 11:09 am
Forum: Compiler
Topic: const string array limits
Replies: 1
Views: 1957

const string array limits

I ran across a compiler issue while using the following... const sHelp() as string = ( "this is a test of const string array length", // line is ok...max length (69+1=70) "123456789012345678901234567890123456789012345678901234567890123456789", // line is too long (70+1=71)...compiler terminates "123...
by Jerry Messina
Mon Feb 09, 2009 10:25 am
Forum: Compiler
Topic: syntax for 'prototype' declaration
Replies: 2
Views: 1905

syntax for 'prototype' declaration

I just tried to use the 'prototype' keyword (as outlined in http://www.sfcompiler.co.uk/forum/posti ... ote&p=5000),
but I keep getting an "END expected" error at the line containing

Code: Select all

sub myNeededFunc() prototype
What am I doing wrong?

Jerry
by Jerry Messina
Mon Feb 09, 2009 9:58 am
Forum: Modules
Topic: usart SetBaudrate issue
Replies: 2
Views: 3229

usart SetBaudrate issue

There appears to be a problem with the usart baud rate routine when using the 16-bit BRG. The module assumes that the SPBRG/SPBRGH registers are adjacent in the memory map, and there are a number of devices where this isn't the case (such as the 18F6680 which I just tried!) For me, changing the code...