Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > sci.electronics.design > #383101
| From | Robert Baer <robertbaer@localnet.com> |
|---|---|
| Newsgroups | sci.electronics.design |
| Subject | Re: OT: More MPLAB program problems |
| References | <cD%Xx.19186$a85.1429@fx19.iad> <n0q1um$u3i$1@speranza.aioe.org> |
| Message-ID | <FEkYx.14884$I83.14799@fx04.iad> (permalink) |
| Date | 2015-10-29 01:19 -0800 |
Martin Brown wrote:
> On 28/10/2015 09:24, Robert Baer wrote:
>> Problems.
>>
>> Code snippet #1:
>> CLRW
>> ADDWF swcount,W ; count to W
>> BTFSC STATUS,Z ; zero count = divide by zero ==> value
>> as zero
>> GOTO BY1
>> DECF swcount,W ; count = 1 ** Neither W nor swcount
>> change; WTF?
>> ; assembles to 0x032A which decodes to DECF direction "W", swcount.
>
> A reasonable guess for these symptoms would be that swcount is not
> actually pointing to ram and it is rather hard to alter rom.
* 0x032A decodes to DECF loc(swcount) .. see below:
LIST p=P16F648A
;; * header stuff removed..
; VARIABLES
timhi EQU 0x20 ; time pointer (0-1023)
timlo EQU 0x21
COUNT1 EQU 0x22 ; delay counter
COUNT2 EQU 0x23
COUNT3 EQU 0x24
sSTATUS EQU 0x25
sW EQU 0x26
amphi EQU 0x27
amplo EQU 0x28
ampres EQU 0x29
swcount EQU 0x2A ; <--- RAM!
>
> TI9900 series could get into that sort of bind if it ever ended up with
> all of its registers in ROM (including the program counter).
>
> BTW If you described what the intention of the code was instead of
> adding cryptic crossword clues here and there and missing out crucial
> details like the symbol definitions then it would be easier to help.
>
> TBH I think you would be better off with a more suitable chip that had
> enough hardware capacity to do the job properly. Maybe even copying the
> data to RAM so that you can do lookups much faster with FSR.
>
* 1) The PIC16F648A cannot work with the FSR, 2) my data for access is
in the form of RETLW <dataval> and 3) my data tables are rather large (~1K).
Would you be so kind as to also address the other problems?
Back to sci.electronics.design | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
OT: More MPLAB program problems Robert Baer <robertbaer@localnet.com> - 2015-10-28 01:24 -0800
Re: OT: More MPLAB program problems Martin Brown <|||newspam|||@nezumi.demon.co.uk> - 2015-10-28 08:45 +0000
Re: OT: More MPLAB program problems Robert Baer <robertbaer@localnet.com> - 2015-10-29 01:19 -0800
Re: OT: More MPLAB program problems piglet <erichpwagner@hotmail.com> - 2015-10-28 09:59 +0000
Re: OT: More MPLAB program problems Robert Baer <robertbaer@localnet.com> - 2015-10-29 01:45 -0800
Re: OT: More MPLAB program problems piglet <erichpwagner@hotmail.com> - 2015-10-29 09:31 +0000
Re: OT: More MPLAB program problems Martin Brown <|||newspam|||@nezumi.demon.co.uk> - 2015-10-29 08:52 +0000
csiph-web