Если начинать изучать мелкоконтроллеры с нуля, то все же авр'ки более подходят для этого, пмнм хотя..
Без переделки нельзя.
насилу нашел на винте (сорри за длинную цитату - оригинальная страничка уже давно умерла), для 628 подходит. (если поможет, конечно)
---
Subject: [PIC]: Checklist for 16F84 to 16F627 code conversion
From: Ian Chapman (
pic@CHAPMIP.DEMON.CO.UK)
Date: Thu Aug 02 2001 - 16:34:37 PDT
Folks,
I have been converting several 16F84 code files to run on the (cheaper)
16F627 parts. This generally seems to be a trivial task as the spec of
the F627 is a superset of that of the F84, but it seems to me that there
are some key differences which may be "gotchas" for the uninitiated.
I haven't seen a "minimum checklist" of points to resolve during this
conversion, so I thought I'd share my own list and invite comments:
1. General purpose registers start at 20H instead of 0CH.
(ACTION: Change CBLOCK start addresses and any other relevant
equates accordingly)
2. General purpose registers are not mapped across into all Banks
(except for 70H-7FH and its images). For example, on the F84, one
could assign a register with a Bank 0 address and assume that it
can still be accessed when RP0 is set. On the F627, the change to
RP0 will cause a different register to be accessed! In particular,
this is an issue for interrupt service routines for the F84 which
"doesn't care" about the state of the bank select bits on entry.
(ACTION: Check and correct any register accesses which occur while
bank bits are set to non-default values. Change interrupt service
routines to either use shared RAM (70H-7FH) for temporary storage,
or implement solution described in section 14.7 (Example 14-1) of
F627 data book)
3. CMCON register must be initialised to 07H after reset to ensure that
digital I/O (instead of comparator input) is enabled on RA0-RA4.
(ACTION: Add CMCON initialisation code to start-up routines)
4. EEADR and EEDATA registers have moved from Bank 0 to Bank 1.
(ACTION: Change positions of "BSF STATUS,RP0" and "BCF STATUS, RP0"
instructions in EEPROM read and write code fragments) (*)
(N.B. My copy of the 16F62X data book ("Preliminary") appears to
have implemented this change in Example 13-2 (Data EEPROM Write)
but not in Examples 13-1 and 13-3)
5. EEIE bit has moved from INTCON register (accessible from any Bank)
to PIE1 register (Bank 1 only), and EEIF bit has moved from EECON1
register (Bank 1 only) to PIR1 (Bank 0 only).
(ACTION: Change BSF/BCF instructions accordingly and ensure Bank
bits are set correctly before attempting to access these bits)
6. PROCESSOR (or LIST) directive needs to be changed from 16F84 to
16F627, and __CONFIG directive needs to include _LVP_OFF (to free
up RB4) and _BODEN_OFF (for strict F84 compatibility).
(ACTION: Change directives as indicated above)
As I understand it, CMCON is the only special function register that is
"new" in the F627 which needs to be explicitly initialised after reset
to ensure F84 compatibility. However, there may be a case for explicit
initialisation of other registers for extra robustness - any views?
Obviously, I haven't attempted to cover above any code optimisations
that may be possible given the greater resources of the F627 (more RAM
and EEPROM, on-chip USART etc.). I have just focussed on getting the
F627 operating as a "drop-in replacement" for an F84.
Have I missed anything?
--
Ian Chapman
Subject: 16F627,8 'gotchas'
Date: Sun, 21 Oct 2001 11:00:16 -0700
From: "Robert Scobey" @rivergrovewinery.com>
To: "Ian Chapman" <pic>
CC: "don" <dontronics>
Ian,
I found your posting of Aug 2 on converting 16F84 to 16F627. Thank you for sharing your work.
In a similar effort I found another 'gotcha' If you are doing 'in circuit programming', or developing using DONTRONICS DT001 (an excellent device), beware of having voltagepullup on RB4 of 16F627,8. RB4 must be open or at 0 volts to have drop in hardware circuit compatability to the 16F84. Otherwise, low voltage programming is requested by 16F627,8.
Subject: Re: [PIC]: 16F84A - 16F627 CONVERSION
Date: Tue, 27 Nov 2001 08:54:48 +1100
From: Tony Nixon <Tony>
Reply-To: pic microcontroller discussion list <PICLIST>
It would pay to read the data sheet as there are a few differences.
More ROM/RAM/EEPROM
EEPROM Read/Write registers located at different addresses
Disable the comparators
movlw b'00000111' ; disable comparators
movwf CMCON
RB4 used for LVP mode if LVP FUSE active
More fuses to set, MCLR, OSC1 and OSC2 can be used as IO pins
UART and Comparators
Probably more, but I can't think of them
Oh yeah - cheaper!!
Best regards Tony
---