Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.electronics.design > #380911 > unrolled thread

OT: table CALL does not work

Started byRobert Baer <robertbaer@localnet.com>
First post2015-10-09 12:36 -0700
Last post2015-10-12 18:12 +0100
Articles 17 — 6 participants

Back to article view | Back to sci.electronics.design


Contents

  OT: table CALL does not work Robert Baer <robertbaer@localnet.com> - 2015-10-09 12:36 -0700
    Re: OT: table CALL does not work "P E Schoen" <paul@pstech-inc.com> - 2015-10-09 18:00 -0400
      Re: OT: table CALL does not work Robert Baer <robertbaer@localnet.com> - 2015-10-10 00:19 -0700
    Re: OT: table CALL does not work Nobody <nobody@nowhere.invalid> - 2015-10-09 23:32 +0100
      Re: OT: table CALL does not work Robert Baer <robertbaer@localnet.com> - 2015-10-10 00:32 -0700
        Re: OT: table CALL does not work Martin Brown <|||newspam|||@nezumi.demon.co.uk> - 2015-10-10 09:56 +0100
          Re: table CALL does not work "P E Schoen" <paul@pstech-inc.com> - 2015-10-10 18:38 -0400
            Re: table CALL does not work Martin Brown <|||newspam|||@nezumi.demon.co.uk> - 2015-10-12 09:10 +0100
        Re: OT: table CALL does not work Nobody <nobody@nowhere.invalid> - 2015-10-11 22:50 +0100
          Re: OT: table CALL does not work Robert Baer <robertbaer@localnet.com> - 2015-10-11 23:23 -0700
    Re: OT: table CALL does not work Martin Riddle <martin_ridd@verizon.net> - 2015-10-11 00:27 -0400
      Re: OT: table CALL does not work Martin Riddle <martin_ridd@verizon.net> - 2015-10-11 00:33 -0400
        Re: OT: table CALL does not work Robert Baer <robertbaer@localnet.com> - 2015-10-11 13:37 -0700
          Re: OT: table CALL does not work Martin Riddle <martin_ridd@verizon.net> - 2015-10-11 20:54 -0400
      Re: OT: table CALL does not work Robert Baer <robertbaer@localnet.com> - 2015-10-11 13:35 -0700
    Re: OT: table CALL does not work bitrex <bitrex@de.lete.earthlink.net> - 2015-10-11 16:44 -0400
      Re: OT: table CALL does not work Martin Brown <|||newspam|||@nezumi.demon.co.uk> - 2015-10-12 18:12 +0100

#380911 — OT: table CALL does not work

FromRobert Baer <robertbaer@localnet.com>
Date2015-10-09 12:36 -0700
SubjectOT: table CALL does not work
Message-ID<TGURx.175753$WK.81663@fx10.iad>
   Program:

        LIST p=P16F648A
        #include P16F648A.inc
          ; Was P16F628A
        __CONFIG       _CP_OFF & _WDT_OFF & _PWRTE_OFF & _HS_OSC & 
_LVP_OFF & _MCLRE_OFF & _BOREN_OFF
        __IDLOCS       0x0001

;                  VARIABLES
ptrlo       EQU         0x20    ; table pointer
ptrhi       EQU         0x21
COUNT1      EQU         0x22    ; delay counter
COUNT2      EQU         0x23
COUNT3      EQU         0x24
sSTATUS     EQU         0x25
sW          EQU         0x26
;
         ORG     0x0000
         GOTO    start
         GOTO    start
         GOTO    start
         GOTO    start
         ORG     0x0010
start:  ;**             setup I/O
; All pins have 10K in series with an LED to GND except OSC pins (and GND)

         CLRF    6    ; Set all Port B pins to logic 0
         BSF     3,5  ; Bank 1 command comes next STATUS RP0 set
         CLRF    6    ; sel all Port B pins as outputs
         BCF     3,5  ; Bank 0 command comes next STATUS RP0 clear

         CLRF    ptrlo
         CLRF    ptrhi

         CLRW
         MOVWF   6       ; Port B to zero
         CALL    DELAY   ; "freeze" LEDs

         MOVLW   0xFF
         MOVWF   6       ; Port B ones
         CALL    DELAY   ; "freeze" LEDs
setup:
        MOVLW    Low(tab1)
        ADDWF    ptrlo,W   ; add pointer to W
        MOVLW    High(tab1)
        BTFSC    STATUS,C
        INCF     PCLATH,F  ; W=1
        CALL     tab1 ;;*REMoving this, one sees 0x00 0xFF 0x01 repeating
     ;   RETurns here      ;; otherwise, LEDs show 0x00 0xFF repeating
         MOVWF   6       ; Port B from W
         CALL    DELAY   ; "freeze" LEDs
         GOTO    start

repeat:	;;*This part disabled for now..
         INCF    ptrlo           ; next loc
;        BTFSC   STATUS,C
;        INCF    ptrhi
         MOVF    ptrlo,W
     ;  CALL     tab1    ;;*REMoving this, one sees W counting
                 ;; otherwise, LEDs show 0x00 0xFF 0x00 0xFF 0x00 etc
         MOVWF   6       ; Port B from W
         CALL    DELAY   ; "freeze" LEDs
         GOTO    repeat

; ----------------------------------------------
DELAY   MOVWF   sW
       ; MOVF    STATUS,W
       ; MOVWF   sSTATUS
         CLRF    COUNT1
         CLRF    COUNT2
         MOVLW   d'43'  ; fudge for about 4 Sec delay
         MOVWF   COUNT3
LUPINR  DECFSZ  COUNT1
         GOTO    LUPINR
         DECFSZ  COUNT2
         GOTO    LUPINR
         DECFSZ  COUNT3
         GOTO    LUPINR
DEXIT:; MOVF    sSTATUS,W
       ; MOVWF   STATUS
         MOVF    sW,W
         RETURN
; ---------------------------------------------- sine
         ORG             0x0100
tab1:
      ;;   RETLW   0x01    ;       [0]     t=0.7500        r=0.0000
         ADDWF   PCL,F
         RETLW   0x15    ;       [1]     t=0.7539        r=0.0240
         RETLW   0x14    ;       [2]     t=0.7578        r=0.0964
         RETLW   0x13    ;       [3]     t=0.7617        r=0.2173
         RETLW   0x12    ;       [4]     t=0.7656        r=0.3865
         RETLW   0x02    ;       [5]     t=0.7695        r=0.6040

   WHAT in all heck is happening??

[toc] | [next] | [standalone]


#380928

From"P E Schoen" <paul@pstech-inc.com>
Date2015-10-09 18:00 -0400
Message-ID<mv9dak$aur$1@dont-email.me>
In reply to#380911
"Robert Baer"  wrote in message news:TGURx.175753$WK.81663@fx10.iad...

[snip code]
>   WHAT in all heck is happening??

Have you used the simulator and single step to see what's happening (or 
not)?

It's quite difficult enough to follow such convoluted and poorly documented 
code, and you insist on using register address numbers rather than the 
mnemonics, which is more obfuscation. Table calls DO work, but it seems you 
are adding extra code for some reason and then question why it doesn't work.

Sorry, can't help.

Paul 

[toc] | [prev] | [next] | [standalone]


#380966

FromRobert Baer <robertbaer@localnet.com>
Date2015-10-10 00:19 -0700
Message-ID<s_2Sx.224$e36.88@fx06.iad>
In reply to#380928
P E Schoen wrote:
> "Robert Baer" wrote in message news:TGURx.175753$WK.81663@fx10.iad...
>
> [snip code]
>> WHAT in all heck is happening??
>
> Have you used the simulator and single step to see what's happening (or
> not)?
>
> It's quite difficult enough to follow such convoluted and poorly
> documented code, and you insist on using register address numbers rather
> than the mnemonics, which is more obfuscation. Table calls DO work, but
> it seems you are adding extra code for some reason and then question why
> it doesn't work.
>
> Sorry, can't help.
>
> Paul
   The "extra code" is the setup for 8-bit display using the LEDs (at 
least the RB0-RB7) and a "freeze" delay to allow visual confirmation of 
what might be happening.
   Somewhere i saw that the "simulator" and single-stepping would not 
work for the PIC16F48A (and i do have the so-called debug header, which 
is a modified (and more expensive) version.
   Cannot use it as there is no space on the project board for that 
monster (in process of making a whole new board).

[toc] | [prev] | [next] | [standalone]


#380931

FromNobody <nobody@nowhere.invalid>
Date2015-10-09 23:32 +0100
Message-ID<pan.2015.10.09.22.32.36.258000@nowhere.invalid>
In reply to#380911
On Fri, 09 Oct 2015 12:36:18 -0700, Robert Baer wrote:

> setup:
>         MOVLW    Low(tab1)
>         ADDWF    ptrlo,W   ; add pointer to W
>         MOVLW    High(tab1)
>         BTFSC    STATUS,C
>         INCF     PCLATH,F  ; W=1
>         CALL     tab1 ;;*REMoving this, one sees 0x00 0xFF 0x01 repeating

Here, W contains High(tab1), PCLATH contains zero.

If you can ensure that the table doesn't cross a page boundary, it
suffices to use:

	MOVLW	High(tab1)
	MOVWF	PCLATH
	MOVF	ptrlo,W
	CALL	tab1

In the most general case, you have to allow for the fact that tab1 might
not even be on the same 2k super-page as the target RETLW instruction,
meaning that PCLATH needs different values for the CALL and the computed
goto, which basically means that the calculation needs to be moved into
the table routine. E.g.

	MOVLW	High(tab1)	; far call to tab1
	MOVWF	PCLATH
	CALL	tab1

	...

tab1:
	MOVLW	High(tab1_data)
	ADDWF	ptrhi,W
	MOVWF	PCLATH

	MOVLW	Low(tab1_data)
	ADDWF	ptrlo,W
	BTFSC	STATUS,C
	INCF	PCLATH,F

	MOVWF	PCL,F

tab1_data:
	RETLW	...

[toc] | [prev] | [next] | [standalone]


#380967

FromRobert Baer <robertbaer@localnet.com>
Date2015-10-10 00:32 -0700
Message-ID<oa3Sx.3124$CV7.2368@fx30.iad>
In reply to#380931
Nobody wrote:
> On Fri, 09 Oct 2015 12:36:18 -0700, Robert Baer wrote:
>
>> setup:
>>          MOVLW    Low(tab1)
>>          ADDWF    ptrlo,W   ; add pointer to W
>>          MOVLW    High(tab1)
>>          BTFSC    STATUS,C
>>          INCF     PCLATH,F  ; W=1
>>          CALL     tab1 ;;*REMoving this, one sees 0x00 0xFF 0x01 repeating
>
> Here, W contains High(tab1), PCLATH contains zero.
* Yes, that is the way i see it also.

>
> If you can ensure that the table doesn't cross a page boundary, it
> suffices to use:
>
> 	MOVLW	High(tab1)
> 	MOVWF	PCLATH
> 	MOVF	ptrlo,W
> 	CALL	tab1
>
> In the most general case, you have to allow for the fact that tab1 might
> not even be on the same 2k super-page as the target RETLW instruction,
> meaning that PCLATH needs different values for the CALL and the computed
> goto, which basically means that the calculation needs to be moved into
> the table routine. E.g.
>
> 	MOVLW	High(tab1)	; far call to tab1
> 	MOVWF	PCLATH
> 	CALL	tab1
>
> 	...
>
> tab1:
> 	MOVLW	High(tab1_data)
> 	ADDWF	ptrhi,W
> 	MOVWF	PCLATH
>
> 	MOVLW	Low(tab1_data)
> 	ADDWF	ptrlo,W
> 	BTFSC	STATUS,C
> 	INCF	PCLATH,F
>
> 	MOVWF	PCL,F
>
> tab1_data:
> 	RETLW	...
>
* I have noted that, and it looks nice for a presumed look-up "anywhere".
   BUT..
   The "gotcha" is nothing is pushed on the stack, so WTH does the 
program go after the RETURN/RETLW?
   And can one rely on the unknown/undefined stack contents/

   My goal is to have a number of 1K look-up tables entry at 0x0100 
sections.

[toc] | [prev] | [next] | [standalone]


#380971

FromMartin Brown <|||newspam|||@nezumi.demon.co.uk>
Date2015-10-10 09:56 +0100
Message-ID<mvajso$ai9$1@speranza.aioe.org>
In reply to#380967
On 10/10/2015 08:32, Robert Baer wrote:
> Nobody wrote:
>> On Fri, 09 Oct 2015 12:36:18 -0700, Robert Baer wrote:
>>
>>> setup:
>>>          MOVLW    Low(tab1)
>>>          ADDWF    ptrlo,W   ; add pointer to W
>>>          MOVLW    High(tab1)
>>>          BTFSC    STATUS,C
>>>          INCF     PCLATH,F  ; W=1
>>>          CALL     tab1 ;;*REMoving this, one sees 0x00 0xFF 0x01
>>> repeating
>>
>> Here, W contains High(tab1), PCLATH contains zero.
> * Yes, that is the way i see it also.
>
>>
>> If you can ensure that the table doesn't cross a page boundary, it
>> suffices to use:
>>
>>     MOVLW    High(tab1)
>>     MOVWF    PCLATH
>>     MOVF    ptrlo,W
>>     CALL    tab1
>>
>> In the most general case, you have to allow for the fact that tab1 might
>> not even be on the same 2k super-page as the target RETLW instruction,
>> meaning that PCLATH needs different values for the CALL and the computed
>> goto, which basically means that the calculation needs to be moved into
>> the table routine. E.g.
>>
>>     MOVLW    High(tab1)    ; far call to tab1
>>     MOVWF    PCLATH
>>     CALL    tab1
>>
>>     ...
>>
>> tab1:
>>     MOVLW    High(tab1_data)
>>     ADDWF    ptrhi,W
>>     MOVWF    PCLATH
>>
>>     MOVLW    Low(tab1_data)
>>     ADDWF    ptrlo,W
>>     BTFSC    STATUS,C
>>     INCF    PCLATH,F
>>
>>     MOVWF    PCL,F
>>
>> tab1_data:
>>     RETLW    ...
>>
> * I have noted that, and it looks nice for a presumed look-up "anywhere".
>    BUT..
>    The "gotcha" is nothing is pushed on the stack, so WTH does the
> program go after the RETURN/RETLW?
>    And can one rely on the unknown/undefined stack contents/
>
>    My goal is to have a number of 1K look-up tables entry at 0x0100
> sections.

For heavens sake! *Single step* the failing code in a PIC *emulator* and 
watch exactly what happens at the critical point. Get the basic version 
I posted working first and then modify it to use pages!!!!

Crash and burn with obfuscated code is no way to run a circus.

You could probably get away with a toy hobby board that just supplied 
power to the device and a LED to flash PICAXE or whatever. You have 
already wasted several multiples of the tools cost in your time.

-- 
Regards,
Martin Brown

[toc] | [prev] | [next] | [standalone]


#381011 — Re: table CALL does not work

From"P E Schoen" <paul@pstech-inc.com>
Date2015-10-10 18:38 -0400
SubjectRe: table CALL does not work
Message-ID<mvc3td$lcb$1@dont-email.me>
In reply to#380971
"Martin Brown"  wrote in message news:mvajso$ai9$1@speranza.aioe.org...

> For heavens sake! *Single step* the failing code in a PIC *emulator* and 
> watch exactly what happens at the critical point. Get the basic version I 
> posted working first and then modify it to use pages!!!!

> Crash and burn with obfuscated code is no way to run a circus.

> You could probably get away with a toy hobby board that just supplied 
> power to the device and a LED to flash PICAXE or whatever. You have 
> already wasted several multiples of the tools cost in your time.

The Microchip software simulator works very well for simple stuff like this 
and it's included free in the MPLAB IDE. The MPLABX simulator is a bit 
trickier to use but still works very well. You can set up watches for 
variables, and inspect and modify the contents of RAM, and single step or 
run to cursor or use breakpoints. There is a stopwatch which is useful for 
timing loops (but you must be sure to set the clock frequency properly). You 
can even use external register injection files to simulate ADC inputs, and 
manual stimulus to simulate pushbuttons.

A hardware emulator or debugger is rarely needed.

Paul 

[toc] | [prev] | [next] | [standalone]


#381141 — Re: table CALL does not work

FromMartin Brown <|||newspam|||@nezumi.demon.co.uk>
Date2015-10-12 09:10 +0100
SubjectRe: table CALL does not work
Message-ID<mvfptm$901$1@speranza.aioe.org>
In reply to#381011
On 10/10/2015 23:38, P E Schoen wrote:
> "Martin Brown"  wrote in message news:mvajso$ai9$1@speranza.aioe.org...
>
>> For heavens sake! *Single step* the failing code in a PIC *emulator*
>> and watch exactly what happens at the critical point. Get the basic
>> version I posted working first and then modify it to use pages!!!!
>
>> Crash and burn with obfuscated code is no way to run a circus.
>
>> You could probably get away with a toy hobby board that just supplied
>> power to the device and a LED to flash PICAXE or whatever. You have
>> already wasted several multiples of the tools cost in your time.
>
> The Microchip software simulator works very well for simple stuff like
> this and it's included free in the MPLAB IDE. The MPLABX simulator is a
> bit trickier to use but still works very well. You can set up watches
> for variables, and inspect and modify the contents of RAM, and single
> step or run to cursor or use breakpoints. There is a stopwatch which is
> useful for timing loops (but you must be sure to set the clock frequency
> properly). You can even use external register injection files to
> simulate ADC inputs, and manual stimulus to simulate pushbuttons.
>
> A hardware emulator or debugger is rarely needed.

Last time I was playing with PICs it was a DOS based emulator but quite 
capable although newer ships were not supported. But jump tables for 
function value lookup definitely worked fine I used them extensively.

-- 
Regards,
Martin Brown

[toc] | [prev] | [next] | [standalone]


#381080

FromNobody <nobody@nowhere.invalid>
Date2015-10-11 22:50 +0100
Message-ID<pan.2015.10.11.21.51.26.511000@nowhere.invalid>
In reply to#380967
On Sat, 10 Oct 2015 00:32:36 -0700, Robert Baer wrote:

>    The "gotcha" is nothing is pushed on the stack, so WTH does the
> program go after the RETURN/RETLW?

"CALL tab1" pushes the address of the following instruction onto
the stack. "RETLW" pops it. The computed goto ("MOVWF PCL,F")
between the two doesn't touch the stack.

[toc] | [prev] | [next] | [standalone]


#381126

FromRobert Baer <robertbaer@localnet.com>
Date2015-10-11 23:23 -0700
Message-ID<FlISx.89570$s%4.39573@fx20.iad>
In reply to#381080
Nobody wrote:
> On Sat, 10 Oct 2015 00:32:36 -0700, Robert Baer wrote:
>
>>     The "gotcha" is nothing is pushed on the stack, so WTH does the
>> program go after the RETURN/RETLW?
>
> "CALL tab1" pushes the address of the following instruction onto
> the stack. "RETLW" pops it. The computed goto ("MOVWF PCL,F")
> between the two doesn't touch the stack.
>
   Correct; but that is the way supposedly working program samples are 
presented.

[toc] | [prev] | [next] | [standalone]


#381035

FromMartin Riddle <martin_ridd@verizon.net>
Date2015-10-11 00:27 -0400
Message-ID<i7pj1b5tm1p57ivftqdlgreg7u77buspko@4ax.com>
In reply to#380911
On Fri, 09 Oct 2015 12:36:18 -0700, Robert Baer
<robertbaer@localnet.com> wrote:

>   Program:
>
>        LIST p=P16F648A
>        #include P16F648A.inc
>          ; Was P16F628A
>        __CONFIG       _CP_OFF & _WDT_OFF & _PWRTE_OFF & _HS_OSC & 
>_LVP_OFF & _MCLRE_OFF & _BOREN_OFF
>        __IDLOCS       0x0001
>
>;                  VARIABLES
>ptrlo       EQU         0x20    ; table pointer
>ptrhi       EQU         0x21
>COUNT1      EQU         0x22    ; delay counter
>COUNT2      EQU         0x23
>COUNT3      EQU         0x24
>sSTATUS     EQU         0x25
>sW          EQU         0x26
>;
>         ORG     0x0000
>         GOTO    start
>         GOTO    start
>         GOTO    start
>         GOTO    start
>         ORG     0x0010
>start:  ;**             setup I/O
>; All pins have 10K in series with an LED to GND except OSC pins (and GND)
>
>         CLRF    6    ; Set all Port B pins to logic 0
>         BSF     3,5  ; Bank 1 command comes next STATUS RP0 set
>         CLRF    6    ; sel all Port B pins as outputs
>         BCF     3,5  ; Bank 0 command comes next STATUS RP0 clear
>
>         CLRF    ptrlo
>         CLRF    ptrhi
>
>         CLRW
>         MOVWF   6       ; Port B to zero
>         CALL    DELAY   ; "freeze" LEDs
>
>         MOVLW   0xFF
>         MOVWF   6       ; Port B ones
>         CALL    DELAY   ; "freeze" LEDs
>setup:
>        MOVLW    Low(tab1)
>        ADDWF    ptrlo,W   ; add pointer to W
>        MOVLW    High(tab1)
>        BTFSC    STATUS,C
>        INCF     PCLATH,F  ; W=1
>        CALL     tab1 ;;*REMoving this, one sees 0x00 0xFF 0x01 repeating
>     ;   RETurns here      ;; otherwise, LEDs show 0x00 0xFF repeating
>         MOVWF   6       ; Port B from W
>         CALL    DELAY   ; "freeze" LEDs
>         GOTO    start
>
>repeat:	;;*This part disabled for now..
>         INCF    ptrlo           ; next loc
>;        BTFSC   STATUS,C
>;        INCF    ptrhi
>         MOVF    ptrlo,W
>     ;  CALL     tab1    ;;*REMoving this, one sees W counting
>                 ;; otherwise, LEDs show 0x00 0xFF 0x00 0xFF 0x00 etc
>         MOVWF   6       ; Port B from W
>         CALL    DELAY   ; "freeze" LEDs
>         GOTO    repeat
>
>; ----------------------------------------------
>DELAY   MOVWF   sW
>       ; MOVF    STATUS,W
>       ; MOVWF   sSTATUS
>         CLRF    COUNT1
>         CLRF    COUNT2
>         MOVLW   d'43'  ; fudge for about 4 Sec delay
>         MOVWF   COUNT3
>LUPINR  DECFSZ  COUNT1
>         GOTO    LUPINR
>         DECFSZ  COUNT2
>         GOTO    LUPINR
>         DECFSZ  COUNT3
>         GOTO    LUPINR
>DEXIT:; MOVF    sSTATUS,W
>       ; MOVWF   STATUS
>         MOVF    sW,W
>         RETURN
>; ---------------------------------------------- sine
>         ORG             0x0100
>tab1:
>      ;;   RETLW   0x01    ;       [0]     t=0.7500        r=0.0000
>         ADDWF   PCL,F
>         RETLW   0x15    ;       [1]     t=0.7539        r=0.0240
>         RETLW   0x14    ;       [2]     t=0.7578        r=0.0964
>         RETLW   0x13    ;       [3]     t=0.7617        r=0.2173
>         RETLW   0x12    ;       [4]     t=0.7656        r=0.3865
>         RETLW   0x02    ;       [5]     t=0.7695        r=0.6040
>
>   WHAT in all heck is happening??



Try.....  ;D

; ---------------------------------------------- sine
         ORG             0x0050
tab1:
      ;;   RETLW   0x01    ;       [0]     t=0.7500        r=0.0000
         ADDWF   PCL;,F
         RETLW   0x15    ;       [1]     t=0.7539        r=0.0240
         RETLW   0x14    ;       [2]     t=0.7578        r=0.0964
         RETLW   0x13    ;       [3]     t=0.7617        r=0.2173
         RETLW   0x12    ;       [4]     t=0.7656        r=0.3865
         RETLW   0x02    ;       [5]     t=0.7695        r=0.6040


This is why MOVWF  PCL is perfered.

Cheers

[toc] | [prev] | [next] | [standalone]


#381036

FromMartin Riddle <martin_ridd@verizon.net>
Date2015-10-11 00:33 -0400
Message-ID<vipj1bp9g3ljvs0i1he885ake84qbei2us@4ax.com>
In reply to#381035
On Sun, 11 Oct 2015 00:27:53 -0400, Martin Riddle
<martin_ridd@verizon.net> wrote:

>On Fri, 09 Oct 2015 12:36:18 -0700, Robert Baer
><robertbaer@localnet.com> wrote:
>
>>   Program:
>>
>>        LIST p=P16F648A
>>        #include P16F648A.inc
>>          ; Was P16F628A
>>        __CONFIG       _CP_OFF & _WDT_OFF & _PWRTE_OFF & _HS_OSC & 
>>_LVP_OFF & _MCLRE_OFF & _BOREN_OFF
>>        __IDLOCS       0x0001
>>
>>;                  VARIABLES
>>ptrlo       EQU         0x20    ; table pointer
>>ptrhi       EQU         0x21
>>COUNT1      EQU         0x22    ; delay counter
>>COUNT2      EQU         0x23
>>COUNT3      EQU         0x24
>>sSTATUS     EQU         0x25
>>sW          EQU         0x26
>>;
>>         ORG     0x0000
>>         GOTO    start
>>         GOTO    start
>>         GOTO    start
>>         GOTO    start
>>         ORG     0x0010
>>start:  ;**             setup I/O
>>; All pins have 10K in series with an LED to GND except OSC pins (and GND)
>>
>>         CLRF    6    ; Set all Port B pins to logic 0
>>         BSF     3,5  ; Bank 1 command comes next STATUS RP0 set
>>         CLRF    6    ; sel all Port B pins as outputs
>>         BCF     3,5  ; Bank 0 command comes next STATUS RP0 clear
>>
>>         CLRF    ptrlo
>>         CLRF    ptrhi
>>
>>         CLRW
>>         MOVWF   6       ; Port B to zero
>>         CALL    DELAY   ; "freeze" LEDs
>>
>>         MOVLW   0xFF
>>         MOVWF   6       ; Port B ones
>>         CALL    DELAY   ; "freeze" LEDs
>>setup:
>>        MOVLW    Low(tab1)
>>        ADDWF    ptrlo,W   ; add pointer to W
>>        MOVLW    High(tab1)
>>        BTFSC    STATUS,C
>>        INCF     PCLATH,F  ; W=1
>>        CALL     tab1 ;;*REMoving this, one sees 0x00 0xFF 0x01 repeating
>>     ;   RETurns here      ;; otherwise, LEDs show 0x00 0xFF repeating
>>         MOVWF   6       ; Port B from W
>>         CALL    DELAY   ; "freeze" LEDs
>>         GOTO    start
>>
>>repeat:	;;*This part disabled for now..
>>         INCF    ptrlo           ; next loc
>>;        BTFSC   STATUS,C
>>;        INCF    ptrhi
>>         MOVF    ptrlo,W
>>     ;  CALL     tab1    ;;*REMoving this, one sees W counting
>>                 ;; otherwise, LEDs show 0x00 0xFF 0x00 0xFF 0x00 etc
>>         MOVWF   6       ; Port B from W
>>         CALL    DELAY   ; "freeze" LEDs
>>         GOTO    repeat
>>
>>; ----------------------------------------------
>>DELAY   MOVWF   sW
>>       ; MOVF    STATUS,W
>>       ; MOVWF   sSTATUS
>>         CLRF    COUNT1
>>         CLRF    COUNT2
>>         MOVLW   d'43'  ; fudge for about 4 Sec delay
>>         MOVWF   COUNT3
>>LUPINR  DECFSZ  COUNT1
>>         GOTO    LUPINR
>>         DECFSZ  COUNT2
>>         GOTO    LUPINR
>>         DECFSZ  COUNT3
>>         GOTO    LUPINR
>>DEXIT:; MOVF    sSTATUS,W
>>       ; MOVWF   STATUS
>>         MOVF    sW,W
>>         RETURN
>>; ---------------------------------------------- sine
>>         ORG             0x0100
>>tab1:
>>      ;;   RETLW   0x01    ;       [0]     t=0.7500        r=0.0000
>>         ADDWF   PCL,F
>>         RETLW   0x15    ;       [1]     t=0.7539        r=0.0240
>>         RETLW   0x14    ;       [2]     t=0.7578        r=0.0964
>>         RETLW   0x13    ;       [3]     t=0.7617        r=0.2173
>>         RETLW   0x12    ;       [4]     t=0.7656        r=0.3865
>>         RETLW   0x02    ;       [5]     t=0.7695        r=0.6040
>>
>>   WHAT in all heck is happening??
>
>
>
>Try.....  ;D
>
>; ---------------------------------------------- sine
>         ORG             0x0050
>tab1:
>      ;;   RETLW   0x01    ;       [0]     t=0.7500        r=0.0000
>         ADDWF   PCL,F
>         RETLW   0x15    ;       [1]     t=0.7539        r=0.0240
>         RETLW   0x14    ;       [2]     t=0.7578        r=0.0964
>         RETLW   0x13    ;       [3]     t=0.7617        r=0.2173
>         RETLW   0x12    ;       [4]     t=0.7656        r=0.3865
>         RETLW   0x02    ;       [5]     t=0.7695        r=0.6040
>
>
>This is why MOVWF  PCL is perfered.
>
>Cheers

oops, use this

; ---------------------------------------------- sine
         ORG             0x0050
tab1:
         ADDWF   PCL,F
         RETLW   0x15    ;       [1]     t=0.7539        r=0.0240
         RETLW   0x14    ;       [2]     t=0.7578        r=0.0964
         RETLW   0x13    ;       [3]     t=0.7617        r=0.2173
         RETLW   0x12    ;       [4]     t=0.7656        r=0.3865
         RETLW   0x02    ;       [5]     t=0.7695        r=0.6040

Cheers

[toc] | [prev] | [next] | [standalone]


#381069

FromRobert Baer <robertbaer@localnet.com>
Date2015-10-11 13:37 -0700
Message-ID<XLzSx.14677$wr5.12233@fx05.iad>
In reply to#381036
Martin Riddle wrote:
> On Sun, 11 Oct 2015 00:27:53 -0400, Martin Riddle
> <martin_ridd@verizon.net>  wrote:
>
>> On Fri, 09 Oct 2015 12:36:18 -0700, Robert Baer
>> <robertbaer@localnet.com>  wrote:
>>
>>>    Program:
>>>
>>>         LIST p=P16F648A
>>>         #include P16F648A.inc
>>>           ; Was P16F628A
>>>         __CONFIG       _CP_OFF&  _WDT_OFF&  _PWRTE_OFF&  _HS_OSC&
>>> _LVP_OFF&  _MCLRE_OFF&  _BOREN_OFF
>>>         __IDLOCS       0x0001
>>>
>>> ;                  VARIABLES
>>> ptrlo       EQU         0x20    ; table pointer
>>> ptrhi       EQU         0x21
>>> COUNT1      EQU         0x22    ; delay counter
>>> COUNT2      EQU         0x23
>>> COUNT3      EQU         0x24
>>> sSTATUS     EQU         0x25
>>> sW          EQU         0x26
>>> ;
>>>          ORG     0x0000
>>>          GOTO    start
>>>          GOTO    start
>>>          GOTO    start
>>>          GOTO    start
>>>          ORG     0x0010
>>> start:  ;**             setup I/O
>>> ; All pins have 10K in series with an LED to GND except OSC pins (and GND)
>>>
>>>          CLRF    6    ; Set all Port B pins to logic 0
>>>          BSF     3,5  ; Bank 1 command comes next STATUS RP0 set
>>>          CLRF    6    ; sel all Port B pins as outputs
>>>          BCF     3,5  ; Bank 0 command comes next STATUS RP0 clear
>>>
>>>          CLRF    ptrlo
>>>          CLRF    ptrhi
>>>
>>>          CLRW
>>>          MOVWF   6       ; Port B to zero
>>>          CALL    DELAY   ; "freeze" LEDs
>>>
>>>          MOVLW   0xFF
>>>          MOVWF   6       ; Port B ones
>>>          CALL    DELAY   ; "freeze" LEDs
>>> setup:
>>>         MOVLW    Low(tab1)
>>>         ADDWF    ptrlo,W   ; add pointer to W
>>>         MOVLW    High(tab1)
>>>         BTFSC    STATUS,C
>>>         INCF     PCLATH,F  ; W=1
>>>         CALL     tab1 ;;*REMoving this, one sees 0x00 0xFF 0x01 repeating
>>>      ;   RETurns here      ;; otherwise, LEDs show 0x00 0xFF repeating
>>>          MOVWF   6       ; Port B from W
>>>          CALL    DELAY   ; "freeze" LEDs
>>>          GOTO    start
>>>
>>> repeat:	;;*This part disabled for now..
>>>          INCF    ptrlo           ; next loc
>>> ;        BTFSC   STATUS,C
>>> ;        INCF    ptrhi
>>>          MOVF    ptrlo,W
>>>      ;  CALL     tab1    ;;*REMoving this, one sees W counting
>>>                  ;; otherwise, LEDs show 0x00 0xFF 0x00 0xFF 0x00 etc
>>>          MOVWF   6       ; Port B from W
>>>          CALL    DELAY   ; "freeze" LEDs
>>>          GOTO    repeat
>>>
>>> ; ----------------------------------------------
>>> DELAY   MOVWF   sW
>>>        ; MOVF    STATUS,W
>>>        ; MOVWF   sSTATUS
>>>          CLRF    COUNT1
>>>          CLRF    COUNT2
>>>          MOVLW   d'43'  ; fudge for about 4 Sec delay
>>>          MOVWF   COUNT3
>>> LUPINR  DECFSZ  COUNT1
>>>          GOTO    LUPINR
>>>          DECFSZ  COUNT2
>>>          GOTO    LUPINR
>>>          DECFSZ  COUNT3
>>>          GOTO    LUPINR
>>> DEXIT:; MOVF    sSTATUS,W
>>>        ; MOVWF   STATUS
>>>          MOVF    sW,W
>>>          RETURN
>>> ; ---------------------------------------------- sine
>>>          ORG             0x0100
>>> tab1:
>>>       ;;   RETLW   0x01    ;       [0]     t=0.7500        r=0.0000
>>>          ADDWF   PCL,F
>>>          RETLW   0x15    ;       [1]     t=0.7539        r=0.0240
>>>          RETLW   0x14    ;       [2]     t=0.7578        r=0.0964
>>>          RETLW   0x13    ;       [3]     t=0.7617        r=0.2173
>>>          RETLW   0x12    ;       [4]     t=0.7656        r=0.3865
>>>          RETLW   0x02    ;       [5]     t=0.7695        r=0.6040
>>>
>>>    WHAT in all heck is happening??
>>
>>
>>
>> Try.....  ;D
>>
>> ; ---------------------------------------------- sine
>>          ORG             0x0050
>> tab1:
>>       ;;   RETLW   0x01    ;       [0]     t=0.7500        r=0.0000
>>          ADDWF   PCL,F
>>          RETLW   0x15    ;       [1]     t=0.7539        r=0.0240
>>          RETLW   0x14    ;       [2]     t=0.7578        r=0.0964
>>          RETLW   0x13    ;       [3]     t=0.7617        r=0.2173
>>          RETLW   0x12    ;       [4]     t=0.7656        r=0.3865
>>          RETLW   0x02    ;       [5]     t=0.7695        r=0.6040
>>
>>
>> This is why MOVWF  PCL is perfered.
>>
>> Cheers
>
> oops, use this
>
> ; ---------------------------------------------- sine
>           ORG             0x0050
> tab1:
>           ADDWF   PCL,F
>           RETLW   0x15    ;       [1]     t=0.7539        r=0.0240
>           RETLW   0x14    ;       [2]     t=0.7578        r=0.0964
>           RETLW   0x13    ;       [3]     t=0.7617        r=0.2173
>           RETLW   0x12    ;       [4]     t=0.7656        r=0.3865
>           RETLW   0x02    ;       [5]     t=0.7695        r=0.6040
>
> Cheers
   But that is what i have,and it does not work; acts as a "system reset".

[toc] | [prev] | [next] | [standalone]


#381096

FromMartin Riddle <martin_ridd@verizon.net>
Date2015-10-11 20:54 -0400
Message-ID<761m1b5b86dstok9o5gs2khfdhkl7nt30v@4ax.com>
In reply to#381069
On Sun, 11 Oct 2015 13:37:11 -0700, Robert Baer
<robertbaer@localnet.com> wrote:

>Martin Riddle wrote:
>> On Sun, 11 Oct 2015 00:27:53 -0400, Martin Riddle
>> <martin_ridd@verizon.net>  wrote:
>>
>>> On Fri, 09 Oct 2015 12:36:18 -0700, Robert Baer
>>> <robertbaer@localnet.com>  wrote:
>>>
>>>>    Program:
>>>>
>>>>         LIST p=P16F648A
>>>>         #include P16F648A.inc
>>>>           ; Was P16F628A
>>>>         __CONFIG       _CP_OFF&  _WDT_OFF&  _PWRTE_OFF&  _HS_OSC&
>>>> _LVP_OFF&  _MCLRE_OFF&  _BOREN_OFF
>>>>         __IDLOCS       0x0001
>>>>
>>>> ;                  VARIABLES
>>>> ptrlo       EQU         0x20    ; table pointer
>>>> ptrhi       EQU         0x21
>>>> COUNT1      EQU         0x22    ; delay counter
>>>> COUNT2      EQU         0x23
>>>> COUNT3      EQU         0x24
>>>> sSTATUS     EQU         0x25
>>>> sW          EQU         0x26
>>>> ;
>>>>          ORG     0x0000
>>>>          GOTO    start
>>>>          GOTO    start
>>>>          GOTO    start
>>>>          GOTO    start
>>>>          ORG     0x0010
>>>> start:  ;**             setup I/O
>>>> ; All pins have 10K in series with an LED to GND except OSC pins (and GND)
>>>>
>>>>          CLRF    6    ; Set all Port B pins to logic 0
>>>>          BSF     3,5  ; Bank 1 command comes next STATUS RP0 set
>>>>          CLRF    6    ; sel all Port B pins as outputs
>>>>          BCF     3,5  ; Bank 0 command comes next STATUS RP0 clear
>>>>
>>>>          CLRF    ptrlo
>>>>          CLRF    ptrhi
>>>>
>>>>          CLRW
>>>>          MOVWF   6       ; Port B to zero
>>>>          CALL    DELAY   ; "freeze" LEDs
>>>>
>>>>          MOVLW   0xFF
>>>>          MOVWF   6       ; Port B ones
>>>>          CALL    DELAY   ; "freeze" LEDs
>>>> setup:
>>>>         MOVLW    Low(tab1)
>>>>         ADDWF    ptrlo,W   ; add pointer to W
>>>>         MOVLW    High(tab1)
>>>>         BTFSC    STATUS,C
>>>>         INCF     PCLATH,F  ; W=1
>>>>         CALL     tab1 ;;*REMoving this, one sees 0x00 0xFF 0x01 repeating
>>>>      ;   RETurns here      ;; otherwise, LEDs show 0x00 0xFF repeating
>>>>          MOVWF   6       ; Port B from W
>>>>          CALL    DELAY   ; "freeze" LEDs
>>>>          GOTO    start
>>>>
>>>> repeat:	;;*This part disabled for now..
>>>>          INCF    ptrlo           ; next loc
>>>> ;        BTFSC   STATUS,C
>>>> ;        INCF    ptrhi
>>>>          MOVF    ptrlo,W
>>>>      ;  CALL     tab1    ;;*REMoving this, one sees W counting
>>>>                  ;; otherwise, LEDs show 0x00 0xFF 0x00 0xFF 0x00 etc
>>>>          MOVWF   6       ; Port B from W
>>>>          CALL    DELAY   ; "freeze" LEDs
>>>>          GOTO    repeat
>>>>
>>>> ; ----------------------------------------------
>>>> DELAY   MOVWF   sW
>>>>        ; MOVF    STATUS,W
>>>>        ; MOVWF   sSTATUS
>>>>          CLRF    COUNT1
>>>>          CLRF    COUNT2
>>>>          MOVLW   d'43'  ; fudge for about 4 Sec delay
>>>>          MOVWF   COUNT3
>>>> LUPINR  DECFSZ  COUNT1
>>>>          GOTO    LUPINR
>>>>          DECFSZ  COUNT2
>>>>          GOTO    LUPINR
>>>>          DECFSZ  COUNT3
>>>>          GOTO    LUPINR
>>>> DEXIT:; MOVF    sSTATUS,W
>>>>        ; MOVWF   STATUS
>>>>          MOVF    sW,W
>>>>          RETURN
>>>> ; ---------------------------------------------- sine
>>>>          ORG             0x0100
>>>> tab1:
>>>>       ;;   RETLW   0x01    ;       [0]     t=0.7500        r=0.0000
>>>>          ADDWF   PCL,F
>>>>          RETLW   0x15    ;       [1]     t=0.7539        r=0.0240
>>>>          RETLW   0x14    ;       [2]     t=0.7578        r=0.0964
>>>>          RETLW   0x13    ;       [3]     t=0.7617        r=0.2173
>>>>          RETLW   0x12    ;       [4]     t=0.7656        r=0.3865
>>>>          RETLW   0x02    ;       [5]     t=0.7695        r=0.6040
>>>>
>>>>    WHAT in all heck is happening??
>>>
>>>
>>>
>>> Try.....  ;D
>>>
>>> ; ---------------------------------------------- sine
>>>          ORG             0x0050
>>> tab1:
>>>       ;;   RETLW   0x01    ;       [0]     t=0.7500        r=0.0000
>>>          ADDWF   PCL,F
>>>          RETLW   0x15    ;       [1]     t=0.7539        r=0.0240
>>>          RETLW   0x14    ;       [2]     t=0.7578        r=0.0964
>>>          RETLW   0x13    ;       [3]     t=0.7617        r=0.2173
>>>          RETLW   0x12    ;       [4]     t=0.7656        r=0.3865
>>>          RETLW   0x02    ;       [5]     t=0.7695        r=0.6040
>>>
>>>
>>> This is why MOVWF  PCL is perfered.
>>>
>>> Cheers
>>
>> oops, use this
>>
>> ; ---------------------------------------------- sine
>>           ORG             0x0050
>> tab1:
>>           ADDWF   PCL,F
>>           RETLW   0x15    ;       [1]     t=0.7539        r=0.0240
>>           RETLW   0x14    ;       [2]     t=0.7578        r=0.0964
>>           RETLW   0x13    ;       [3]     t=0.7617        r=0.2173
>>           RETLW   0x12    ;       [4]     t=0.7656        r=0.3865
>>           RETLW   0x02    ;       [5]     t=0.7695        r=0.6040
>>
>> Cheers
>   But that is what i have,and it does not work; acts as a "system reset".

With ORG 0x0050 ????

Cheers

[toc] | [prev] | [next] | [standalone]


#381068

FromRobert Baer <robertbaer@localnet.com>
Date2015-10-11 13:35 -0700
Message-ID<ZJzSx.14594$wr5.8306@fx05.iad>
In reply to#381035
Martin Riddle wrote:
> On Fri, 09 Oct 2015 12:36:18 -0700, Robert Baer
> <robertbaer@localnet.com>  wrote:
>
>>    Program:
>>
>>         LIST p=P16F648A
>>         #include P16F648A.inc
>>           ; Was P16F628A
>>         __CONFIG       _CP_OFF&  _WDT_OFF&  _PWRTE_OFF&  _HS_OSC&
>> _LVP_OFF&  _MCLRE_OFF&  _BOREN_OFF
>>         __IDLOCS       0x0001
>>
>> ;                  VARIABLES
>> ptrlo       EQU         0x20    ; table pointer
>> ptrhi       EQU         0x21
>> COUNT1      EQU         0x22    ; delay counter
>> COUNT2      EQU         0x23
>> COUNT3      EQU         0x24
>> sSTATUS     EQU         0x25
>> sW          EQU         0x26
>> ;
>>          ORG     0x0000
>>          GOTO    start
>>          GOTO    start
>>          GOTO    start
>>          GOTO    start
>>          ORG     0x0010
>> start:  ;**             setup I/O
>> ; All pins have 10K in series with an LED to GND except OSC pins (and GND)
>>
>>          CLRF    6    ; Set all Port B pins to logic 0
>>          BSF     3,5  ; Bank 1 command comes next STATUS RP0 set
>>          CLRF    6    ; sel all Port B pins as outputs
>>          BCF     3,5  ; Bank 0 command comes next STATUS RP0 clear
>>
>>          CLRF    ptrlo
>>          CLRF    ptrhi
>>
>>          CLRW
>>          MOVWF   6       ; Port B to zero
>>          CALL    DELAY   ; "freeze" LEDs
>>
>>          MOVLW   0xFF
>>          MOVWF   6       ; Port B ones
>>          CALL    DELAY   ; "freeze" LEDs
>> setup:
>>         MOVLW    Low(tab1)
>>         ADDWF    ptrlo,W   ; add pointer to W
>>         MOVLW    High(tab1)
>>         BTFSC    STATUS,C
>>         INCF     PCLATH,F  ; W=1
>>         CALL     tab1 ;;*REMoving this, one sees 0x00 0xFF 0x01 repeating
>>      ;   RETurns here      ;; otherwise, LEDs show 0x00 0xFF repeating
>>          MOVWF   6       ; Port B from W
>>          CALL    DELAY   ; "freeze" LEDs
>>          GOTO    start
>>
>> repeat:	;;*This part disabled for now..
>>          INCF    ptrlo           ; next loc
>> ;        BTFSC   STATUS,C
>> ;        INCF    ptrhi
>>          MOVF    ptrlo,W
>>      ;  CALL     tab1    ;;*REMoving this, one sees W counting
>>                  ;; otherwise, LEDs show 0x00 0xFF 0x00 0xFF 0x00 etc
>>          MOVWF   6       ; Port B from W
>>          CALL    DELAY   ; "freeze" LEDs
>>          GOTO    repeat
>>
>> ; ----------------------------------------------
>> DELAY   MOVWF   sW
>>        ; MOVF    STATUS,W
>>        ; MOVWF   sSTATUS
>>          CLRF    COUNT1
>>          CLRF    COUNT2
>>          MOVLW   d'43'  ; fudge for about 4 Sec delay
>>          MOVWF   COUNT3
>> LUPINR  DECFSZ  COUNT1
>>          GOTO    LUPINR
>>          DECFSZ  COUNT2
>>          GOTO    LUPINR
>>          DECFSZ  COUNT3
>>          GOTO    LUPINR
>> DEXIT:; MOVF    sSTATUS,W
>>        ; MOVWF   STATUS
>>          MOVF    sW,W
>>          RETURN
>> ; ---------------------------------------------- sine
>>          ORG             0x0100
>> tab1:
>>       ;;   RETLW   0x01    ;       [0]     t=0.7500        r=0.0000
>>          ADDWF   PCL,F
>>          RETLW   0x15    ;       [1]     t=0.7539        r=0.0240
>>          RETLW   0x14    ;       [2]     t=0.7578        r=0.0964
>>          RETLW   0x13    ;       [3]     t=0.7617        r=0.2173
>>          RETLW   0x12    ;       [4]     t=0.7656        r=0.3865
>>          RETLW   0x02    ;       [5]     t=0.7695        r=0.6040
>>
>>    WHAT in all heck is happening??
>
>
>
> Try.....  ;D
>
> ; ---------------------------------------------- sine
>           ORG             0x0050
> tab1:
>        ;;   RETLW   0x01    ;       [0]     t=0.7500        r=0.0000
>           ADDWF   PCL;,F
>           RETLW   0x15    ;       [1]     t=0.7539        r=0.0240
>           RETLW   0x14    ;       [2]     t=0.7578        r=0.0964
>           RETLW   0x13    ;       [3]     t=0.7617        r=0.2173
>           RETLW   0x12    ;       [4]     t=0.7656        r=0.3865
>           RETLW   0x02    ;       [5]     t=0.7695        r=0.6040
>
>
> This is why MOVWF  PCL is perfered.
>
> Cheers
   Thanks; will try that.

[toc] | [prev] | [next] | [standalone]


#381070

Frombitrex <bitrex@de.lete.earthlink.net>
Date2015-10-11 16:44 -0400
Message-ID<VSzSx.83092$Z_6.72896@fx12.iad>
In reply to#380911
On 10/9/2015 3:36 PM, Robert Baer wrote:
>    Program:
>
>         LIST p=P16F648A
>         #include P16F648A.inc
>           ; Was P16F628A
>         __CONFIG       _CP_OFF & _WDT_OFF & _PWRTE_OFF & _HS_OSC &
> _LVP_OFF & _MCLRE_OFF & _BOREN_OFF
>         __IDLOCS       0x0001

I don't know about PIC, but these days avr-gcc is so well optimized that 
using straight assembly to write anything that's not speed-critical even 
on small AVR microcontrollers just seems pathological.

[toc] | [prev] | [next] | [standalone]


#381204

FromMartin Brown <|||newspam|||@nezumi.demon.co.uk>
Date2015-10-12 18:12 +0100
Message-ID<mvgpll$tm4$1@speranza.aioe.org>
In reply to#381070
On 11/10/2015 21:44, bitrex wrote:
> On 10/9/2015 3:36 PM, Robert Baer wrote:
>>    Program:
>>
>>         LIST p=P16F648A
>>         #include P16F648A.inc
>>           ; Was P16F628A
>>         __CONFIG       _CP_OFF & _WDT_OFF & _PWRTE_OFF & _HS_OSC &
>> _LVP_OFF & _MCLRE_OFF & _BOREN_OFF
>>         __IDLOCS       0x0001
>
> I don't know about PIC, but these days avr-gcc is so well optimized that
> using straight assembly to write anything that's not speed-critical even
> on small AVR microcontrollers just seems pathological.

For very small chunks of code it can be quicker than linking an HLL.

The last thing I wanted to do was very low power so the code was speed 
critical only in the sense that the faster it executed the slower the 
system clock and longer the battery life ~3y on 2xAA.

It also did some tricky jitter based frequency generation (awful phase 
noise but quite good averaged over the longer term).

-- 
Regards,
Martin Brown

[toc] | [prev] | [standalone]


Back to top | Article view | sci.electronics.design


csiph-web