Searching \ for '[PIC]: ?PIC18C452 BUG?' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=pic
Search entire site for: '?PIC18C452 BUG?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: ?PIC18C452 BUG?'
2000\09\06@091300 by Thomas C. Sefranek

face picon face
I may have found an obscure bug in the 452.

I am using a Jump table (Vector table) I designed to provide 128 possible
vectors
relative to the value of the W (Index).

It works 99% of the time....

BUT, If I get an interupt coincident with the code on line 28:
MOVFF PCLOW,PCL
The PIC stack the next address as the return address instead of the address I
just built!
So I have a hack fix to keep my program working. (See the next line of code.)
But I should like to hear from you folks, any ideas?  Is this a genuine bug?
(Did I miss the warning somewhere?)

Assembly Listing segment:
000218 C01A FFF9      00028                 MOVFF PCLOW,PCL         ; Goto
supporting routine for this state.
00029 ;
00021C 0000           00030 MENU_TABLE      DW 0                    ; Dummy
address.
00021E 0224           00031 M1              DW Menu_Init    ; "START", Send
greeting.
000220 025E           00032 M2              DW Wait4Term    ; Look for user's
answer.
000222 02B2           00033 M3              DW SendMenu             ; Send the
menu.

MPLAB Trace Listing:
0B14  0010  ReturnIRQ RETFIE      02D 04  W  04  00000000 00000100F9
0B16  6E2D   (Forced NOP)              ---  --  ---  --  00000000 00000100FA
021C  0000  MENU_TABLE NOP    ---  --  ---  --  00000000 00000100FB
021E  0224  M1 MULWF      0x24     ---  --  ---  --  00000000 00000100FC
0220  025E  M2 MULWF      0x5E  024  00  ---  --  00000000 00000100FD
0222  02B2  M3 MULWF   0xFB2  05E  00  ---  --  00000000 00000100FE

FIX I made:
00021C C01A FFF9  00028 Bug_Fix MOVFF PCLOW,PCL  ; Goto supporting routine for
this state.
000220 EF0E F001    00029                 GOTO    Bug_Fix         ; Hack fix.
                                  00030 ;
000224 0000              00031 MENU_TABLE      DW 0            ; Dummy address.

--
 *
 |  __O    Thomas C. Sefranek  spam_OUTtcsTakeThisOuTspamcmcorp.com
 |_-\<,_   Amateur Radio Operator: WA1RHP
 (*)/ (*)  Bicycle mobile on 145.41, 448.625 MHz

ARRL Instructor, Technical Specialist, VE Contact.
hamradio.cmcorp.com/inventory/Inventory.html
http://www.harvardrepeater.org

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2000\09\06@094451 by Scott Dattalo

face
flavicon
face
On Wed, 6 Sep 2000, Thomas C. Sefranek wrote:

> I may have found an obscure bug in the 452.
>
> I am using a Jump table (Vector table) I designed to provide 128 possible
> vectors
> relative to the value of the W (Index).
>
> It works 99% of the time....
>
> BUT, If I get an interupt coincident with the code on line 28:
> MOVFF PCLOW,PCL
> The PIC stack the next address as the return address instead of the address I
> just built!
> So I have a hack fix to keep my program working. (See the next line of code.)
> But I should like to hear from you folks, any ideas?  Is this a genuine bug?
> (Did I miss the warning somewhere?)

yuck.

>
> FIX I made:
> 00021C C01A FFF9  00028 Bug_Fix MOVFF PCLOW,PCL  ; Goto supporting routine for
> this state.
> 000220 EF0E F001    00029                 GOTO    Bug_Fix         ; Hack fix.
>                                    00030 ;
> 000224 0000              00031 MENU_TABLE      DW 0            ; Dummy address.

Another fix would be:

   MOVF  PCLOW,W
   MOVWF PCL

with the side affect that W is trashed.



Scott

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2000\09\06@100149 by Michael Rigby-Jones

flavicon
face
{Quote hidden}

My PIC18CXX2 Data Sheet states that "The MOVFF instruction cannot use the
PCL, TOSU, TOSH or TOSL as the destination register".  Page 216 under the
instruction descriptions.

Mike

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

2000\09\06@110002 by Thomas C. Sefranek

face picon face
Michael Rigby-Jones wrote:

>
> My PIC18CXX2 Data Sheet states that "The MOVFF instruction cannot use the
> PCL, TOSU, TOSH or TOSL as the destination register".  Page 216 under the
> instruction descriptions.
>
> Mike
>
> --
> http://www.piclist.com hint: The PICList is archived three different
> ways.  See http://www.piclist.com/#archives for details.

I took out my HIGHLIGHTER and marked that section.
THANKS Mike!

--
 *
 |  __O    Thomas C. Sefranek  .....tcsKILLspamspam.....cmcorp.com
 |_-\<,_   Amateur Radio Operator: WA1RHP
 (*)/ (*)  Bicycle mobile on 145.41, 448.625 MHz

ARRL Instructor, Technical Specialist, VE Contact.
hamradio.cmcorp.com/inventory/Inventory.html
http://www.harvardrepeater.org

--
http://www.piclist.com hint: The PICList is archived three different
ways.  See http://www.piclist.com/#archives for details.

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