gnupic: clrw


Previous by date: 28 Aug 2002 08:40:22 -0000 Re: clrw, Craig Franklin
Next by date: 28 Aug 2002 08:40:22 -0000 Re: clrw, Samuel Tardieu
Previous in thread: 28 Aug 2002 08:40:22 -0000 Re: clrw, Craig Franklin
Next in thread: 28 Aug 2002 08:40:22 -0000 Re: clrw, Samuel Tardieu

Subject: Re: clrw
From: "Eric Smith" ####@####.####
Date: 28 Aug 2002 08:40:22 -0000
Message-Id: <33406.64.169.63.74.1030523970.squirrel@ruckus.brouhaha.com>

Craig Franklin ####@####.#### wrote:

> At some point in the past, Microchip changed the documented clrw
> encoding for 14 bit devices.  It changed from 0x103 to the version with
> the don't cares.  Some of the datasheets for the older 14 bit devices
> still show the old encoding.

In older 14-bit devices, the 01yy instruction encoding would cause a
memory read of location yy.  The actual data that was read was not used
for anything.  When using 0100, this causes a read of INDF.  Most of
the time this has no effect.  But if FSR happens to point to a register
for which reading has a side effect (i.e., the UART receive data register),
the side effect will occur, which is presumably not what you want when
you use the clrw instruction.

Microchip has reportedly fixed this problem in later 14-bit devices,
however 0103 is compatible with both old and new devices, and will not
trigger this behavior in the old devices because reading location 03
has no side effect.

> gputils, like mpasm, uses the older 0x103 encoding,

Actually 0103 is the *newer* encoding, although it is only needed to
support older parts.  Unfortunately all my old Microchip data sheets
are in storage, so I can't check the details in the first revision of
the PIC16C71 data sheet.  So I'll admit to there being some chance
that my recollection is flawed.







Previous by date: 28 Aug 2002 08:40:22 -0000 Re: clrw, Craig Franklin
Next by date: 28 Aug 2002 08:40:22 -0000 Re: clrw, Samuel Tardieu
Previous in thread: 28 Aug 2002 08:40:22 -0000 Re: clrw, Craig Franklin
Next in thread: 28 Aug 2002 08:40:22 -0000 Re: clrw, Samuel Tardieu


Powered by ezmlm-browse 0.20.