<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-2">
<META content="MSHTML 6.00.2900.5659" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Takze jsem udelal hokus pokus. (Vypis programu je
na konci mailu.) Advanced Breakpoint jsem nastavil na Promenna_B, zapis hodnoty
0x55.</FONT></DIV>
<DIV><FONT face=Arial size=2>Program se zastavil, ale probehly dalsi
instrukce:</FONT></DIV>
<DIV><FONT face=Arial size=2> </FONT></DIV>
<DIV><FONT face=Arial size=2> movwf
Promenna_B</FONT></DIV>
<DIV><FONT face=Arial size=2> retfi FAST</FONT></DIV>
<DIV><FONT face=Arial size=2> </FONT><FONT face=Arial
size=2>nop ; tady je uklazatel v MPLABU</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Takze ICDII advanced breakpoin funguje i v
preruseni. </FONT><FONT face=Arial size=2>Normalni breakpoint funguje jak
ma.</FONT></DIV>
<DIV><FONT face=Arial size=2>Zpozdeni je ruzne:</FONT></DIV>
<DIV><FONT face=Arial size=2>Program breakpoint: zastavuje na dalsi
instrukci</FONT></DIV>
<DIV><FONT face=Arial size=2>Advanced break point - zapis hodnoty: zastavuje na
treti instrukci</FONT></DIV>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>Advanced break point - cteni hodnoty: zastavuje
na dalsi instrukci (nejake zmatene - po resetu na druhe
instrukci)</FONT></DIV>
<DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>
<DIV><FONT face=Arial size=2>Advanced break point - pouze zapis: zastavuje
na dalsi instrukci
<DIV><FONT face=Arial size=2>Preruseni: Advanced break point - pouze zapis:
zastavuje na treti instrukci</FONT></DIV></FONT></DIV></FONT><FONT
face=Arial size=2><FONT face=Arial size=2>Advanced break point - pouze cteni:
zastavuje na dalsi instrukci</FONT></DIV></FONT></DIV>
<DIV> </DIV>Skoda ze neni nekde detailni popis ICDII. Kolik je toho reseno
pomoci HW/ SW.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Michal Gregor</FONT></DIV>
<DIV><FONT face=Arial size=2>PS: Program taky zkousi chybu Fast Stack register,
ale u 8723 se nastesti neprojevuje</DIV>
<DIV><BR> </FONT></DIV>
<DIV><FONT face=Arial
size=2>;***********************************************************************<BR>;<BR>;
Test breakpointu v ICD II<BR>;
18F8723<BR>;<BR>;**********************************************************************<BR>;**********************************************************************<BR>;**********************************************************************</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> list
p=18F8723<BR> #include <p18F8723.inc><BR> </FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> CONFIG OSC = HS<BR> CONFIG FCMEN =
OFF<BR> CONFIG IESO = OFF<BR> CONFIG PWRT = OFF<BR> CONFIG BOREN
= OFF<BR> CONFIG WDT = OFF<BR> CONFIG MODE = MC<BR> CONFIG WAIT =
OFF<BR> <BR> CONFIG MCLRE = ON<BR> CONFIG STVREN =
OFF<BR> CONFIG LVP = OFF<BR> CONFIG XINST = OFF<BR> CONFIG DEBUG
= ON<BR> CONFIG CP0 = OFF<BR> CONFIG CP1 = OFF<BR> CONFIG CP2 =
OFF<BR> CONFIG CP3 = OFF<BR> CONFIG CP4 = OFF<BR> CONFIG CP5 =
OFF<BR> CONFIG CP6 = OFF<BR> CONFIG CP7 = OFF</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> CONFIG CPB = OFF<BR> CONFIG CPD =
OFF</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> CONFIG WRT0 = OFF<BR> CONFIG WRT1 =
OFF<BR> CONFIG WRT2 = OFF<BR> CONFIG WRT3 = OFF<BR> CONFIG WRT4 =
OFF<BR> CONFIG WRT5 = OFF<BR> CONFIG WRT6 = OFF<BR> CONFIG WRT7 =
OFF<BR>;**********************************************************************</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV><FONT face=Arial size=2>
<DIV><BR>Promenna_A equ 0<BR>Promenna_B equ 1<BR>Promenna_C equ
2<BR>Promenna_D equ 3</DIV>
<DIV> </DIV>
<DIV>W_Temp equ 4<BR>STATUS_Temp equ
5<BR>;*********************************************************<BR> org 0</DIV>
<DIV> </DIV>
<DIV> nop<BR> bcf INTCON,GIE<BR>
goto
Start
<BR>;*********************************************************<BR>;Přerušení jen
CCP1</DIV>
<DIV> </DIV>
<DIV> org 0x16</DIV>
<DIV> </DIV>
<DIV>; movwf W_Temp<BR>; movff STATUS,STATUS_Temp<BR> <BR>;---------------------------------------------------------------------<BR>;Ukončení
přerušení</DIV>
<DIV> </DIV>
<DIV>Navrat bcf PIR1,CCP1IF<BR> clrf T1CON<BR> <BR> movlw 0x55<BR> movwf Promenna_B<BR> <BR>; movff W_Temp,WREG<BR>; movff STATUS_Temp,STATUS</DIV>
<DIV> </DIV>
<DIV> retfie
FAST<BR>;**********************************************************************<BR>;**********************************************************************<BR>Start clrf INTCON<BR> <BR> <BR> clrf STATUS</DIV>
<DIV> </DIV>
<DIV> setf TRISA<BR> setf TRISB<BR> setf TRISC<BR> setf TRISD<BR> setf TRISE<BR> setf TRISF<BR> setf TRISG<BR> setf TRISH</DIV>
<DIV> </DIV>
<DIV> movlw b'00000100' ;
CCP1<BR> movwf PIE1<BR> movlw b'01000000' ;pouze
periferie<BR> movwf INTCON<BR> clrf PIR1
;Vynulovat<BR> <BR> movlw 0x4<BR> movwf CCPR1L<BR> movlw 0x00<BR> movwf CCPR1H<BR> movlw b'00001011'<BR> movwf CCP1CON</DIV>
<DIV> </DIV>
<DIV><BR> bsf INTCON,GIE<BR>;**********************************************************************<BR>;Hlavní
smyčka</DIV>
<DIV> </DIV>
<DIV>Cykluj<BR> clrf Promenna_B<BR> clrf TMR1L<BR> clrf TMR1H<BR> movlw b'00000001'<BR> movwf T1CON</DIV>
<DIV> </DIV>
<DIV> movlw 6<BR> movwf Promenna_A<BR> movlw 5<BR> movff Promenna_A,WREG<BR> nop<BR> nop<BR> nop</DIV>
<DIV> </DIV>
<DIV> movlw 7<BR> movwf Promenna_A<BR> movlw 8<BR> movff Promenna_A,WREG</DIV>
<DIV> </DIV>
<DIV> movlw 9<BR> movwf Promenna_A<BR> movlw 10<BR> movff Promenna_A,WREG</DIV>
<DIV> </DIV>
<DIV> <BR> goto Cykluj<BR> end</DIV>
<DIV> </DIV>
<DIV></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<BLOCKQUOTE
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B>
<A title=hw_aj@zoznam.sk href="mailto:hw_aj@zoznam.sk">andrej jancura</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=hw-list@list.hw.cz
href="mailto:hw-list@list.hw.cz">HW-news</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, December 01, 2008 5:43
PM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: ICD2 - breakpoints</DIV>
<DIV><BR></DIV>To je prave podla mna ten omyl. Myslim si, ze to je riesene
tak, ze to <BR>pozera len opkod zapis do pamati a ma to registre kde su
ulozene <BR>adresy. Aspon takto by som to riesil v HW emulatore. ICD je
na <BR>podobny druh dbg nevhodne, pretoze ma len jeden register na stop, a to
<BR>tiez len pre konkretne adresy. Uz si to presne nepamatam, ale myslim
<BR>si, to advanced znamena len to, ze tie stop-registre su
styri.<BR><BR>Pokial potrebujes naozaj nieco slusne robit, musis si pozriet
nejaky <BR>HW emulator. Asix mal pre PIC16, ale len 8-pinove. ICD je len low
cost <BR>pre bastlicov, ale na profi pracu sa nehodi. Mimochodom to co
<BR>poskytuje robila uz stara HC11 a vsetky novsie HC08. Tam sa da pouzit
<BR>dbg monitor bud ten v eprom, alebo si ho natiahnut do RAM a mal presne
<BR>take iste obmedzenia ako ICD. Realne prerusenia sa tym nedali
<BR>debugovat tiez.<BR><BR>A.<BR><BR><BR>On Mon, 1 Dec 2008 13:32:28
+0100<BR> "Michal HW" <<A
href="mailto:michalgregor@centrum.cz">michalgregor@centrum.cz</A>>
wrote:<BR>> Je to psane v C - vypis pameti. Prvni radek zapisuje
hodnotu(0x272 - <BR>>0x00) do WREG,<BR>> ICDII neni nikde popsan. Rada
16 ma specielni registr pro adresu <BR>>breakpointu. Ale jak je to delane
na 18xxxx jsem nezjistil. Podle mne <BR>>tam ale pro breakpointy v RAMce
musi byt nejaka HW podpora.<BR>> <BR>> Michal Gregor<BR>> <BR>>
<BR>> ----- Original Message ----- <BR>> From: andrej
jancura <BR>> To: HW-news <BR>> Sent: Monday, December 01,
2008 12:56 PM<BR>> Subject: Re: ICD2 - breakpoints<BR>> <BR>>
<BR>> No len jedna poznamka, WREG ma na prvom riadku hodnotu >254
? Skus <BR>>si <BR>> tam napisat MOVLW...<BR>> <BR>>
Na dbg interrupt rutiny by som ICD nepouzil, nakolko sa jedna o sw
<BR>> emulovanie a to hold v isr moc dobre nemusi nechodi.<BR>>
<BR>> A.<BR>> <BR>> <BR>> <BR>> On Mon, 1 Dec 2008
12:35:20 +0100<BR>> "Michal HW" <<A
href="mailto:michalgregor@centrum.cz">michalgregor@centrum.cz</A>>
wrote:<BR>> > Zkousim najit chybu v programu:<BR>> >
<BR>> > Line Address
Opcode
Label
Disassembly<BR>> > <BR>> > 8546
042C2
C272
MOVFF 0x272, WREG<BR>> > 8547 042C4
FFE8
NOP<BR>> > 8548 042C6
0F07
ADDLW 0x7<BR>> > 8549 042C8
CFE8
MOVFF WREG, Pocet_B<BR>> > 8550
042CA
FD3D
NOP<BR>> > 8551 042CC
C0B7
MOVFF Ukazatel, Vstup_P<BR>> > 8552
042CE
F0BB
NOP<BR>> > 8553 042D0
C0B8
MOVFF Vstup_K, 0xbc<BR>> > 8554
042D2
F0BC
NOP<BR>> > 8555 042D4
C0B9
MOVFF Vstup, 0xbd<BR>> > 8556 042D6
F0BD
NOP<BR>> > 8557 042D8
EC08
CALL Sloz_Konec, 0<BR>> > 8558 042DA
F029
NOP<BR>> > 8559 042DC
6E00
MOVWF 0, ACCESS<BR>> > 8560 042DE
CD3D
MOVFF Pocet_B, 0x1<BR>> > <BR>> > Promenna Pocet_B ma
chybnou hodnotu 0x05. Nastavil jsem si <BR>>Advanced <BR>> >
breakpoint na zapis hodnoty 0x05 do Pocet_B.<BR>> > <BR>>
> ICDII se zastavi na radku 8553, ktery vubec s Pocet_B
nepracuje.<BR>> > <BR>> > 0x272 obsahuje 0. Pocet_B ma
0x05. (Vysledek mel byt 7)<BR>> > <BR>> > Vypada to ze
z preruseni se vrati spatny obsah WREG. Kdyby se v <BR>>
>preruseni <BR>> > zapisovala hodnota 0x05 do Pocet_B, tak to
ICDII zachyti, Nebo <BR>>ne?<BR>> > Procesor je 18F8723. ERRATA
jsou prazdne, takze chybu s Fast <BR>>Stack <BR>> >Registrem
<BR>> > by nemel mit.<BR>> > <BR>> >
Michal Gregor <BR>> > <BR>>
_______________________________________________<BR>> HW-list mailing
list - sponsored by <A
href="http://www.HW.cz">www.HW.cz</A><BR>> <A
href="mailto:Hw-list@list.hw.cz">Hw-list@list.hw.cz</A><BR>> <A
href="http://list.hw.cz/mailman/listinfo/hw-list">http://list.hw.cz/mailman/listinfo/hw-list</A><BR><BR>_______________________________________________<BR>HW-list
mailing list - sponsored by <A
href="http://www.HW.cz">www.HW.cz</A><BR><A
href="mailto:Hw-list@list.hw.cz">Hw-list@list.hw.cz</A><BR><A
href="http://list.hw.cz/mailman/listinfo/hw-list">http://list.hw.cz/mailman/listinfo/hw-list</A><BR><BR></BLOCKQUOTE></BODY></HTML>