5
Rev. 0.1 11/10 Copyright © 2010 by Silicon Laboratories AN530 AN530 C8051F90 X /91 X /98 X /99 X S OFTWARE P ORTING G UIDE 1. Introduction The C8051F91x-90x and C8051F99x-98x device families have many similarities, and code written for one platform can easily be ported to the other family with minor modifications. The C8051F91x-90x family has devices that range from 16 kB to 8 kB flash, and the C8051F99x-98x family has devices that range from 8 kB to 2 kB flash. Figure 1 shows the various memory size options in these device families. This application note is designed to help the programmer easily port code between the two product families and primarily highlights differences between the device families. Two devices will be used as the reference parts for comparison, the C8051F902 and C8051F996. Differences within each product family will also be indicated where applicable. 2. Key Points Header File Usage—The header files for the C8051F91x-90x and C8051F99x-98x device families cannot be interchanged. Package—C8051F91x-90x and C8051F99x-98x devices are available in pin-compatible 24-pin QFN packages. Devices may be interchanged when the design has a supply voltage higher than 1.8 V and does not use P1.6. The F99x–F98x is also available in a 3x3 mm package. Power—All devices in the C8051F9xx family share the same low-power modes and have excellent power efficiency. C8051F9xx devices can achieve active mode currents as low as 150 μA/MHz. Figure 1. C8051F91x and C8051F99x MCU Family Memory Size Options Relevant Devices This application note applies to the following devices: C8051F912, C8051F911. C8051F902, C8051F901, C8051F980, C8051F981, C8051F982, C8051F983, C8051F985, C8051F986, C8051F987, C8051F988, C8051F989, C8051F990, C8051F991, C8051F996, and C8051F997. ‘F912/1 C8051F91x-90x C8051F99x-98x ‘F902/1 16 kB 8 kB ‘F996/7 8 kB 4 kB 2 kB ‘F990/1 ‘F986/7 ‘F980/1 ‘F988/9 ‘F982/3 ‘F985

X/91X/98X/99X SOFTWARE PORTING GUIDEAN530 2 Rev. 0.1 3. Package Options Devices in the C8051F91x-90x and C8051F99x-98x families are available in 24-pin QFN or QSOP packages. 'F99x-98x

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: X/91X/98X/99X SOFTWARE PORTING GUIDEAN530 2 Rev. 0.1 3. Package Options Devices in the C8051F91x-90x and C8051F99x-98x families are available in 24-pin QFN or QSOP packages. 'F99x-98x

Rev. 0.1 11/10 Copyright © 2010 by Silicon Laboratories AN530

AN530

C8051F90X/91X/98X/99X SOFTWARE PORTING GUIDE

1. Introduction

The C8051F91x-90x and C8051F99x-98x device families have many similarities, and code written for one platformcan easily be ported to the other family with minor modifications. The C8051F91x-90x family has devices thatrange from 16 kB to 8 kB flash, and the C8051F99x-98x family has devices that range from 8 kB to 2 kB flash.Figure 1 shows the various memory size options in these device families. This application note is designed to helpthe programmer easily port code between the two product families and primarily highlights differences between thedevice families. Two devices will be used as the reference parts for comparison, the C8051F902 and C8051F996.Differences within each product family will also be indicated where applicable.

2. Key Points

Header File Usage—The header files for the C8051F91x-90x and C8051F99x-98x device families cannot be interchanged.

Package—C8051F91x-90x and C8051F99x-98x devices are available in pin-compatible 24-pin QFN packages. Devices may be interchanged when the design has a supply voltage higher than 1.8 V and does not use P1.6. The F99x–F98x is also available in a 3x3 mm package.

Power—All devices in the C8051F9xx family share the same low-power modes and have excellent power efficiency. C8051F9xx devices can achieve active mode currents as low as 150 µA/MHz.

Figure 1. C8051F91x and C8051F99x MCU Family Memory Size Options

Relevant DevicesThis application note applies to the following devices:C8051F912, C8051F911. C8051F902, C8051F901, C8051F980, C8051F981, C8051F982, C8051F983, C8051F985, C8051F986, C8051F987, C8051F988, C8051F989, C8051F990, C8051F991, C8051F996, and C8051F997.

‘F912/1

C8051F91x-90x C8051F99x-98x

‘F902/1

16 kB

8 kB

‘F996/78 kB

4 kB

2 kB

‘F990/1

‘F986/7 ‘F980/1

‘F988/9 ‘F982/3

‘F985

Page 2: X/91X/98X/99X SOFTWARE PORTING GUIDEAN530 2 Rev. 0.1 3. Package Options Devices in the C8051F91x-90x and C8051F99x-98x families are available in 24-pin QFN or QSOP packages. 'F99x-98x

AN530

2 Rev. 0.1

3. Package Options

Devices in the C8051F91x-90x and C8051F99x-98x families are available in 24-pin QFN or QSOP packages.'F99x-98x devices are also available in a 20-pin 3x3 mm QFN package. The devices in the two families aredesigned to be pin-compatible (24-pin packages only); however, port I/O remapping may be needed in someapplications. Figure 2 shows the pinout differences between the 24-pin packages in each family.

The primary pinout difference to note is that P1.6 on the C8051F902 is a no-connect on C8051F996 devices. Thedevice families are pin-for-pin compatible in applications that do not use P1.6. On the C8051F996, P1.6 and P1.7can be used as GPIO or as oscillator pins. These pins are dedicated to the crystal function the C8051F902.

Figure 2. 24-Pin Device Pinout Differences

P0.2/XTAL1/RTCOUT P0.3/XTAL2/WAKEOUT

P0.4/TX

P0.5/RX

P0.6/CNVSTR

P0.7/IREF0

P1.0

P1.1

P1.2

P1.3

C805

1F902

- GU

P0.1/AGND

P0.0/VREF

GND

VDD/DC+

DCEN

VBAT

P2.7/C2D P1.4

1

2

3

4

5

6

7

8

9

10

24

23

22

21

20

19

18

17

16

15

XTAL4

XTAL3

11

12

P1.5

P1.6

14

13

GND/DC-

RST/C2CK

P0.2/XTAL1/RTCOUT P0.3/XTAL2/WAKEOUT

P0.4/TX

P0.5/RX

P0.6/CNVSTR

P0.7/IREF0

P1.0

P1.1

P1.2

P1.3

C8051F

996 - GU

P0.1/AGND

P0.0/VREF

GND

VDD

N.C.

N.C.

P2.7/C2D P1.4

1

2

3

4

5

6

7

8

9

10

24

23

22

21

20

19

18

17

16

15

P1.7/XTAL4

P1.6/XTAL3

11

12

P1.5

N.C.

14

13

N.C.

RST/C2CK

P2.

7/C

2D

XT

AL4

XT

AL3

P1.

6

P1.

5

P1.

4

10 11 1287 9

GND/DC-

GND

VDD/DC+

DCEN

VBAT

RST/C2CK

4

5

6

2

1

3

P0.

5/R

X

P0.

4/T

X

P0.

3/X

TA

L2/W

AK

EO

UT

P0.

2/X

TA

L1/R

TC

OU

T

P0.

1/A

GN

D

P0.

0/V

RE

F

222324 20 1921

C8051F902-GM

Top View

P1.3

P1.2

P1.1

P1.0

P0.7/IREF0

P0.6/CNVSTR

15

14

13

17

18

16

P2.

7/C

2D

P1.

7/X

TA

L4

P1.

6/X

TA

L3

N.C

.

P1.

5

P1.

4

10 11 1287 9

N.C.

GND

VDD

N.C.

N.C.

RST/C2CK

4

5

6

2

1

3

P0.

5/R

X

P0.

4/T

X

P0.

3/X

TA

L2/W

AK

EO

UT

P0.

2/X

TA

L1/R

TC

OU

T

P0.

1/A

GN

D

P0.

0/V

RE

F

222324 20 1921

C8051F996-GM

Top View

P1.3

P1.2

P1.1

P1.0

P0.7/IREF0

P0.6/CNVSTR

15

14

13

17

18

16

Page 3: X/91X/98X/99X SOFTWARE PORTING GUIDEAN530 2 Rev. 0.1 3. Package Options Devices in the C8051F91x-90x and C8051F99x-98x families are available in 24-pin QFN or QSOP packages. 'F99x-98x

AN530

Rev. 0.1 3

4. Similarities

There are many similarities between devices in the C8051F91x-90x and C8051F99x-98x product families. Thebehavior of the following peripherals is identical between the two families. Functions or peripherals not listed belowhave minor differences in implementation, and these differences are described in detail in the following paragraphs.

UART0

SPI0

IREF0

CIP-51

Interrupt Handler—Interrupt numbers for functionality present on both devices (e.g., ADC0, Timers, UART, etc) is unchanged.

Timer 0, Timer 1, Timer 2

SMBus

ADC0

5. Memory

Devices in the two product families have different memory sizes; however, flash memory is organized in 512 bytepages in both families. C8051F91x-90x devices have a 512 byte scratchpad. C8051F99x-98x devices do not havea scratchpad. The lock byte and reserved area of flash varies between device families and between devices ineach value. Refer to the device data sheet for the exact location of the lock byte in the device being used.

In some applications, it is useful to determine the device part number at runtime. On C8051F91x-90x devices, thisis done by reading address 0x3FFE in flash memory. On C8051F99x-98x, the DEVICEID SFR register on SFRPage 0xF can be read to determine the device part number at runtime.

C8051F91x-90x devices have 768 bytes (256 + 512) of RAM. C8051F99x-98x devices have 512 bytes (256 + 256)of RAM.

6. SFR Map

C8051F91x-90x and C8051F99x-98x devices have different SFR maps. Software being ported from one device toanother must specify the C8051F990_defs.h header file if the target is a C8051F99x-98x device or theC8051F912_defs.h header file if the target is a C8051F91x-90x device.

7. Clocking

C8051F99x-98x devices include a clocking option (Low Power Oscillator divided by 8), which is not found onC8051F91x-90x devices. This option consumes less power than dividing the Low Power Oscillator by 8 using theglobal system clock divider. See the CLKSEL register description for details.

The two device families have different values for the reset value of the VREG0CN register. On C8051F91x-90xdevices, the Precision Oscillator Bias is enabled on reset, allowing software to enable the Precision Oscillator atany time without writing to the VREG0CN register. If the Precision Oscillator is not used, its bias may be disabled inorder to achieve the lowest active mode current.

In order to save power, C8051F99x-98x devices have the Precision Oscillator Bias disabled on reset. In order touse the Precision Oscillator, software must enable the Precision Oscillator Bias by writing to the VREG0CN registerbefore enabling the Precision Oscillator.

8. DC-DC Converter

The dc-dc converter, which allows a supply voltage as low as 0.9 V, is available only on C8051F91x-90x devices.The minimum supply voltage for C8051F99x-98x devices is 1.8 V.

Page 4: X/91X/98X/99X SOFTWARE PORTING GUIDEAN530 2 Rev. 0.1 3. Package Options Devices in the C8051F91x-90x and C8051F99x-98x families are available in 24-pin QFN or QSOP packages. 'F99x-98x

AN530

4 Rev. 0.1

9. SPI

SPI0 is identical between both device families. SPI1 is only present on C8051F91x-90x devices.

10. PCA

The only difference in the PCA is that C8051F91x-90x devices have six capture/compare modules, andC8051F99x-98x devices have three capture/compare modules. The watchdog timer function is always located onthe last capture/compare module.

11. Timer 3

On C8051F91x-90x devices, Timer 3 has the ability to count or capture Comparator 1 rising edges. OnC8051F99x-98x devices, this functionality is replaced by the ability to count or capture SmaRTClock rising edges.

12. Comparator

C8051F99x-98x devices only have a single comparator (CP0), and its inputs are restricted to P1.0 and P1.1.C8051F91x-90x devices have two comparators (CP0 and CP1) with input multiplexers that may be connected to aselection of pins.

13. CRC Engine

The CRC engine on C8051F91x-90x devices supports a 32-bit and a 16-bit mode. When used with the automatedflash interface, it has a page size of 512 bytes. The CRC SFRs may only be accessed from SFR Page 0xF.

The CRC engine on C8051F99x-98x devices only supports a 16-bit mode and has a page size of 256 bytes. TheCRC SFRs may be accessed from SFR Page 0x0 or SFR Page 0xF.

14. Voltage Reference

The precision voltage reference is only available on C8051F91x-90x devices. Both families include an on-chip1.65 V, High Speed Voltage reference that does not require an external capacitor.

Page 5: X/91X/98X/99X SOFTWARE PORTING GUIDEAN530 2 Rev. 0.1 3. Package Options Devices in the C8051F91x-90x and C8051F99x-98x families are available in 24-pin QFN or QSOP packages. 'F99x-98x

http://www.silabs.com

Silicon Laboratories Inc.400 West Cesar ChavezAustin, TX 78701USA

Simplicity Studio

One-click access to MCU and wireless tools, documentation, software, source code libraries & more. Available for Windows, Mac and Linux!

IoT Portfoliowww.silabs.com/IoT

SW/HWwww.silabs.com/simplicity

Qualitywww.silabs.com/quality

Support and Communitycommunity.silabs.com

DisclaimerSilicon Labs intends to provide customers with the latest, accurate, and in-depth documentation of all peripherals and modules available for system and software implementers using or intending to use the Silicon Labs products. Characterization data, available modules and peripherals, memory sizes and memory addresses refer to each specific device, and "Typical" parameters provided can and do vary in different applications. Application examples described herein are for illustrative purposes only. Silicon Labs reserves the right to make changes without further notice and limitation to product information, specifications, and descriptions herein, and does not give warranties as to the accuracy or completeness of the included information. Silicon Labs shall have no liability for the consequences of use of the information supplied herein. This document does not imply or express copyright licenses granted hereunder to design or fabricate any integrated circuits. The products are not designed or authorized to be used within any Life Support System without the specific written consent of Silicon Labs. A "Life Support System" is any product or system intended to support or sustain life and/or health, which, if it fails, can be reasonably expected to result in significant personal injury or death. Silicon Labs products are not designed or authorized for military applications. Silicon Labs products shall under no circumstances be used in weapons of mass destruction including (but not limited to) nuclear, biological or chemical weapons, or missiles capable of delivering such weapons.

Trademark InformationSilicon Laboratories Inc.® , Silicon Laboratories®, Silicon Labs®, SiLabs® and the Silicon Labs logo®, Bluegiga®, Bluegiga Logo®, Clockbuilder®, CMEMS®, DSPLL®, EFM®, EFM32®, EFR, Ember®, Energy Micro, Energy Micro logo and combinations thereof, "the world’s most energy friendly microcontrollers", Ember®, EZLink®, EZRadio®, EZRadioPRO®, Gecko®, ISOmodem®, Precision32®, ProSLIC®, Simplicity Studio®, SiPHY®, Telegesis, the Telegesis Logo®, USBXpress® and others are trademarks or registered trademarks of Silicon Labs. ARM, CORTEX, Cortex-M3 and THUMB are trademarks or registered trademarks of ARM Holdings. Keil is a registered trademark of ARM Limited. All other products or brand names mentioned herein are trademarks of their respective holders.