Search found 1220 matches

by Jerry Messina
Sat Jun 20, 2009 11:51 am
Forum: Compiler
Topic: Event changes variable
Replies: 1
Views: 1779

Gordon, David has a discussion somewhere of the naming convention used, but basically vars named "SB_" are the system vars, "Fn_" are on the stack-frame (locals and temps), while "Mn_" are the module-level statics. The Mn_ static vars are safe, but the Fn_ vars can be reused by the compiler at any t...
by Jerry Messina
Tue Jun 02, 2009 9:31 am
Forum: Modules
Topic: High/low priortiy interrupts question (again)
Replies: 7
Views: 4777

Your original reply came through right as I posted mine (of course), so you answered 99% of my questions there when you said that everything works normally. If you've got GIEH set and the SSPIE enabled, then I don't see what else could be going on. Since the I2C is the only high priority intr, this ...
by Jerry Messina
Mon Jun 01, 2009 5:23 pm
Forum: Compiler
Topic: any way to disable stack frame recycling?
Replies: 0
Views: 1663

any way to disable stack frame recycling?

I'm trying to fine-tune some interrupt handling code, and have been playing around with the (undocumented) ACCESS modifier. This seems to work great, as it places the locals and temp variables of a subroutine in a new separate stack frame in the access bank. The problem that I have is that when I ha...
by Jerry Messina
Mon Jun 01, 2009 3:42 pm
Forum: Modules
Topic: High/low priortiy interrupts question (again)
Replies: 7
Views: 4777

When you have the priority mechanism enabled(IPEN=1), the PEIE bit becomes GIEL, so that's not the problem. Gordon - On the surface, what you have looks fine. Since there's some code not shown, I'd check: - make sure that you've got the other IPRx priority bits set properly - verify that you're actu...
by Jerry Messina
Sat May 02, 2009 10:02 pm
Forum: Compiler
Topic: High/low priortiy interrupts question
Replies: 13
Views: 5404

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: 5404

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: 5404

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: 5404

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: 2685

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: 2685

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: 2685

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: 2685

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: 1486

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: 3103

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: 4169

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