piclist 2001\02\21\175014a >
Thread: Moving serial routines from 16c74A to 16F877
face BY : Mike Mansheim email (remove spam text)

>> I am about to move some code originally written (not by me)
>> for a 16C74A to a 16F877.  Are there any 'gotchas' to watch
>> out for?  I am particularly concerned about the serial
>> routines possibly being different. There's about 3K of code
>> there, and memory banking appears to be correctly
>> implemented.

> The UART works the same, The A2D is different (8 bit Vs 10 bit), RAM is
> different (top end of each page) and 2 extra banks so STATUS [RP1 and
> IRP] come into use, EEPROM registers added, Fuse changes, ROM from 74 to
> 877 should work ok, plus extra 4K available.

If the original code used RB3 as an i/o, you will need to disable Low
Voltage Programming in the fuses.
The a/d's *should* work correctly despite the change to 10 bits.  In the
F877, the a/d result is left justified by setting ADFM = 0.  Left
justification puts the upper 8 bits in ADRESH (0x1e), which is the same
as ADRES in the c74.  ADFM is bit 7 of ADCON1, which was an
unimplemented bit in the C74, and should have been zero.  So, if the
original code set ADCON1, bit 7 to zero, the a/d's should work as is in
the F877.

http://www.piclist.com hint: PICList Posts must start with ONE topic:
[PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads


See also: www.piclist.com/techref/microchip/ios.htm?key=serial
Reply You must be a member of the piclist mailing list (not only a www.piclist.com member) to post to the piclist. This form requires JavaScript and a browser/email client that can handle form mailto: posts.
Subject (change) Moving serial routines from 16c74A to 16F877

month overview.

new search...