Searching \ for 'PIC16C84 code to copy values to RAM Data' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/microchip/memory.htm?key=data
Search entire site for: 'PIC16C84 code to copy values to RAM Data'.

Truncated match.
PICList Thread
'PIC16C84 code to copy values to RAM Data'
1999\03\02@095037 by YeYo

flavicon
face
part 0 9759 bytes
<META content=text/html;charset=iso-8859-1 http-equiv=Content-Type>
<META content='"MSHTML 4.72.3110.7"' name=GENERATOR>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2></FONT><FONT color=#000000 size=2>I would like to know if
someone can help me with this piece of code for the PIC16C84/16F84, to verify if
is correct.</FONT></DIV>
<DIV><FONT color=#000000 size=2></FONT><FONT size=2>What I would like to do is
to copy using indirect addressing 32 bytes located at Card_Memory to the PIC RAM
(GPR) starting at address 0x0c.</FONT></DIV>
<DIV><FONT size=2></FONT><FONT color=#000000 size=2></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000><FONT face="Courier New"><FONT size=2>; Copy the full
memory card to PIC data memory address 0x0c (32 bytes=256
bits)</FONT></FONT></FONT><FONT size=2><FONT
face="Courier New"></FONT></FONT></DIV>
<DIV><FONT color=#000000><FONT face="Courier New"><FONT
size=2></FONT></FONT></FONT><FONT size=2><FONT
face="Courier New"></FONT></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000><FONT face="Courier New"><FONT
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clrf&nbsp;&nbsp;&nbsp;
Index&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;
Index=0</FONT></FONT></FONT><FONT size=2><FONT
face="Courier New"></FONT></FONT></DIV>
<DIV><FONT color=#000000><FONT face="Courier New"><FONT
size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; movlw&nbsp;&nbsp;
0x20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; W=32 bytes to
copy.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; movwf&nbsp;&nbsp;
Temporal&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; Temporal=32 bytes to
copy.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; movlw&nbsp;&nbsp;
0x0c&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; W=Start to
store in RAM Address 0x0c<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
movwf&nbsp;&nbsp;
FSR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; FSR
point to 0x0c address<BR>Copia<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
movfw&nbsp;&nbsp; Index&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;
W=Index<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; call&nbsp;&nbsp;&nbsp;
Card_Memory&nbsp;&nbsp;&nbsp; ; Store byte of the card in
W.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; movwf&nbsp;&nbsp;
INDF&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; Store W in
RAM address pointed by the FSR.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
incf&nbsp;&nbsp;&nbsp;
Index&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;
Index=Index+1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
incf&nbsp;&nbsp;&nbsp;
FSR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ;
FSR=FSR+1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; decfsz&nbsp;
Temporal,1&nbsp;&nbsp;&nbsp;&nbsp; ; Decrease Temporal until
0.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; goto&nbsp;&nbsp;&nbsp;
Copia&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; Still copying
bytes!.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; clrf&nbsp;&nbsp;&nbsp;
Index&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ; We leave Index
initialized.<BR></FONT></FONT></FONT><FONT size=2><FONT
face="Courier New"></FONT>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
...</FONT></DIV>
<DIV><FONT face="" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=""
size=2>Card_Memory<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
addwf&nbsp;&nbsp; PCL,F<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
retlw&nbsp;&nbsp; 0x00<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
retlw&nbsp;&nbsp; 0x83<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
retlw&nbsp;&nbsp; 0xFF<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
retlw&nbsp;&nbsp; 0xFF<BR>&nbsp;&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bsp;
retlw&nbsp;&nbsp; 0x00<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
retlw&nbsp;&nbsp; 0x00<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
retlw&nbsp;&nbsp; 0x00<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
retlw&nbsp;&nbsp; 0x00<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
retlw&nbsp;&nbsp; 0x00<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
retlw&nbsp;&nbsp; 0x00<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
retlw&nbsp;&nbsp; 0x00<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
retlw&nbsp;&nbsp; 0x00<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
retlw&nbsp;&nbsp; 0x00<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
retlw&nbsp;&nbsp; 0x00<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
retlw&nbsp;&nbsp; 0x00<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
retlw&nbsp;&nbsp; 0x00<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
retlw&nbsp;&nbsp; 0x00<BR></FONT></DIV>
<DIV><FONT face="" size=2></FONT>&nbsp;</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=#000000 size=2>Is this piece of code correct? Is there any
debug like WinIce for the PIC? I think a simulator or debugger to trace line by
line and seeing the status of registers would be of really great help for
me.</FONT></DIV>
<DIV><FONT color=#000000 size=2></FONT><FONT size=2>By the way, Is there any way
to receive all the mails from the PIC List only once or twice in a big
email?</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT size=2>Thanks in advance.</FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000 size=2></FONT>&nbsp;</DIV></BODY></HTML>

</x-html>

1999\03\02@165604 by Tony Nixon

flavicon
picon face
> YeYo wrote:
>
> I would like to know if someone can help me with this piece of code

It looks ok to me.

Just be aware of page boundaries where you locate the Card_Memory data.

> Is this piece of code correct? Is there any debug like WinIce for the
> PIC?

MPLAB from Microchip is free.

--
Best regards

Tony

Multimedia 16F84 Beginners PIC Tools.
** NEW PicNPro Programmer and Port Interface **

http://www.picnpoke.com
Email spam_OUTpicnpokeTakeThisOuTspamcdi.com.au

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...