M16C with CAN - Renesas e

Download Report

Transcript M16C with CAN - Renesas e

Introduction
Purpose
 This training course provides an overview of the Renesas
microcontrollers (MCUs) that provide a CAN peripheral for building
robust and economical networked, multi-processor embedded systems.
Objectives
 Learn about the range of MCUs that have CAN peripherals and how
they fit into the wide range of devices that Renesas offers.
 Get details on M16C CAN MCUs, which are excellent choices for
embedded system applications that apply CAN technology.
Content
 22 pages
 3 questions
Learning Time
 35 minutes
1
© 2009, Renesas Technology America, Inc., All Rights Reserved
Why Use CAN Technology?

Controller Area Network is an increasingly popular 2-wire
(twisted pair) serial-bus communication method that is:
 Reliable (delivering error-free communication)
 Economical (having low wiring and hardware costs)
 Scaleable (allowing easy expandability with low node-connection costs)
 Available (providing many MCU choices with off-the-shelf tool support)

CAN is an ideal design choice for systems that require:





Low cost
High noise immunity
Fast communication speeds
Excellent flexibility for accommodating configuration changes
Compliance to international standards
 A quick time-to-market
 A relatively long product life cycle and long-term support
2
© 2009, Renesas Technology America, Inc., All Rights Reserved
Renesas CAN MCUs
SHSH7058 7058S SH7059
80MHz
SH7055 80MHz
SuperH™
80MHz
40MHz
H8SX/1527
SH714x
SH7047
40MHz
M32R/ECU*
80MHz
40MHz
32-bit RISC
160MHz
32196
160MHz
24MHz
H8S/2612
H8S/2615
24MHz
32186
32176
80MHz
40MHz
M32C/81
M32C/83
32MHz
M16C/29
20MHz
R8C/M16CTiny
8/16-bit CISC
M16C/1N
16MHz
H8/36037
H8/36057
20MHz
3
H8S/2614
H8S/2616
H8S/2628
24MHz
32192
H8S, H8SX
M32C/84,
85, 86
32MHz
M16C/6NK
M16C/6NM
24MHz
M16C/6N4
M16C/6N5
24MHz
M32C/87 M32C/88
32MHz
32MHz
M16C, M32C
16/32-bit CISC
M16C/6NL
M16C/6NN
24MHz
R8C/22
R8C/23
20MHz
Small Package
Under development
* Automotive-type MCUs
SuperH is a trademark of Renesas Technology Corp.
© 2009, Renesas Technology America, Inc., All Rights Reserved
General Features of M16C MCUs
Platform
Best price/performance – for 16/32-bit CPU capabilities
matched to needs of applications
Versatile
Packed with peripherals – to minimize external
components
Broad
Extensive flash and package options – for storage
from 4KB to 1MB, packages with 20 to 144 pins
Powerful
Fast execution, high C code efficiency – for fast
response using less memory
Compatible
Pin, peripheral, and code compatibility – to allow
one PCB design to accommodate different MCUs
Efficient
Balanced power/performance – for systems that
perform well using less power
Quiet
Unmatched EMI/EMS characteristics – to work well
in noise-sensitive and high-noise environments
Easy
Excellent development environment – for shorter design/
debug cycles that get products to market quicker
For more general details on Renesas M16C MCUs, please visit:
http://america.renesas.com/can
4
© 2009, Renesas Technology America, Inc., All Rights Reserved
M16C Family Lineup
Higher-function,Higher
Higher-performance
More Functionality,
Performance
R32C/100
R32C/100
(CISC+RISC+DSP)
M32C/90
(CISC+RISC)
M32C/80
100MHz
Memory, Function
Progression
M32C/94
M32C/95
M32C/96
64MHz@5V
64MHz@5V
64MHz @5V
M32C/87
M32C/88
CAN x 0, 1, 2
CAN x 3
M32C/80
M32C/81
M32C/82
M32C/83
M32C/84
M32C/85
M32C/86
32MHz
CAN x 1
32MHz
CAN x 1
CAN x 1
CAN x 2
CAN x 2
M16C/80
M16C/70
20MHz@5V
34MHz@3V
M16C/30
M16C/30L M16C/30P
(CISC+RISC)
M16C/80
16MHz@5V
(CISC+RISC)
16MHz@3V
M16C/62A M16C/62M M16C/62N M16C/62P
16MHz@5V
M16C/39P
24MHz@3-5V
M16C/6NK,6NM M16C/6NL,6NN
16MHz@5V
10MHz@3V
16MHz@3V
M16C/6V
M16C/6H
M16C/6K
M16C/6S
M16C/6NA
M16C/6NB
CCD, OSD
Teletext
Keyboard
PLC
CAN x 2
CAN x 1
VFD
CAN x 2
M16C/60
(CISC)
(CISC)
ASSP
M16C/Tiny M16C/26 M16C/26A M16C/28
M16C/29
20MHz@3-5V 20MHz@3-5V 20MHz@3-5V 20MHz@3-5V
CAN x 1
M16C/6N4 M16C/6N5
CAN x 2
CAN x 1
M16C/10
M16C/22
M16C/24
M16C/1N
16MHz
LCD
USB 2.0
CAN x 1
ASSP
R8C/Tiny
(CISC)
R8C/10,12
R8C/11,13
R8C/14~/17
R8C/18,1B
R8C/20,21
R8C/22,23
R8C/2x
16MHz@3-5V
20MHz@3-5V
20MHz@3-5V
20MHz@3-5V
20MHz@5V
CAN x 1
20MHz@3-5V
Function trimmed, Lower-pin-count
5
: New product
: Under development
© 2009, Renesas Technology America, Inc., All Rights Reserved
: Under planning
M16C with CAN
Higher-function,Higher
Higher-performance
More Functionality,
Performance
• MCUs offer up to three channels
of FullCAN (CAN ver.2.0B)
R32C/100
R32C/100
(CISC+RISC+DSP)
M32C/90
(CISC+RISC)
100MHz
• CAN functions have passed all
ISO16845 conformance tests
Memory, Function
Progression
M32C/94
M32C/95
M32C/96
64MHz@5V
64MHz@5V
64MHz @5V
M32C/87.
M32C/87
87A M32C/88
CAN
CAN
x 0,
x 0,
1, 1,
2 2
M32C/80
CAN x 3
M32C/80
M32C/81
M32C/82
M32C/83
M32C/84
M32C/85
M32C/86
32MHz
CAN x 1
32MHz
CAN x 1
CAN x 1
CAN x 2
CAN x 2
M16C/80
M16C/70
20MHz@5V
34MHz@3V
M16C/30
M16C/30L M16C/30P
(CISC+RISC)
M16C/80
16MHz@5V
(CISC+RISC)
16MHz@3V
M16C/62A M16C/62M M16C/62N M16C/62P
16MHz@5V
M16C/39P
24MHz@3-5V
M16C/6NK,6NM M16C/6NL,6NN
16MHz@5V
10MHz@3V
16MHz@3V
M16C/6V
M16C/6H
M16C/6K
M16C/6S
M16C/6NA
M16C/6NB
CCD, OSD
Teletext
Keyboard
PLC
CAN x 2
CAN x 1
VFD
CAN x 2
M16C/60
(CISC)
(CISC)
ASSP
M16C/Tiny M16C/26 M16C/26A M16C/28
M16C/29
20MHz@3-5V 20MHz@3-5V 20MHz@3-5V 20MHz@3-5V
CAN x 1
M16C/6N4 M16C/6N5
CAN x 2
CAN x 1
M16C/10
M16C/22
M16C/24
M16C/1N
16MHz
LCD
USB 2.0
CAN x 1
ASSP
R8C/Tiny
(CISC)
R8C/10,12
R8C/11,13
R8C/14~/17
R8C/18,1B
R8C/20,21
R8C/22,
R8C/22,23
23
R8C/2x
16MHz@3-5V
20MHz@3-5V
20MHz@3-5V
20MHz@3-5V
20MHz@5V
CAN x 1
20MHz@3-5V
Function trimmed, Lower-pin-count
6
: New product
: Under development
© 2009, Renesas Technology America, Inc., All Rights Reserved
: Under planning
Features of M16C MCUs with CAN
 Acceptance filters
(R8C, M16C, and M32C)
- One filter for mailboxes 0 to 13
- One filter each for mailboxes 14 and 15
- Plus: Hardware-based acceptance filter support unit (ASU)
 Transmission-abort function
(R8C, M16C, and M32C)
 Extended use of Data Length Code
(R8C, M16C, and M32C)
 Forced bus-off restore function
(R8C, M16C, and M32C)
 Listen-only mode
(R8C and M16C)
 Flash programming via CAN bus
(R8C, M16C, and M32C)
 CAN controller mailboxes: 16 or 32
(R8C & M16C have 16; M32C has 32; next-generation M32C will have 64)
7
© 2009, Renesas Technology America, Inc., All Rights Reserved
M16C CAN Products
Series
Group
CPU
Max. CAN
Freq.
R8C/Tiny
R8C/22, 23
20MHz 1ch
M16C/1N
16MHz 1ch
M16C/Tiny
M16C/29
20MHz 1ch
M16C/6N4
2ch
M16C/6N5 M16C/60
1ch
2ch
M16C/6N M16C/6NK, 6NM
24MHz
2ch
1ch
M16C/6NL, 6NN
1ch
M32C/81
1ch
M32C/83
1ch
1ch
M32C/84
1ch
2ch
M32C/85
2ch
M32C/80
M32C/80 32MHz
M32C/86
2ch
2ch
M32C/87
2ch
1ch
M32C/87A
1ch
M32C/88*
3ch
ROM Memory Capacity [KB]
type
ROM
RAM
Flash
32 to 64
2 to 3
Flash
32 to 64
1 to 3
Flash 96 to 128 8 to 12
Flash 128 to 256 5 to 10
Flash
128
10
Flash 384 to 512
31
Mask 192 to 256 16 to 20
Flash 384 to 512
31
Mask 192 to 256 16 to 20
Mask
128
10 to 12
Flash
512
31
Flash 320 to 512
24
Mask 128 to 320 10 to 24
Flash 320 to 512
24
Mask
320
24
Flash
512
24
Flash 384 to 1024 24 to 48
Mask 384 or 512 24 or 31
Flash
1024
31 to 48
Mask 384 or 512 24 or 31
Flash 320 to 512
18
* M32C/8x MCUs with two or more channels of CAN can be
configured to allocate 32 mailbox slots to one CAN channel.
8
© 2009, Renesas Technology America, Inc., All Rights Reserved
Pins
Number of
Devices
48
48
64, 80
100, 128
100, 128
100, 128
100, 128
100, 128
100, 128
100, 144
100, 144
100, 144
100, 144
100, 144
100, 144
144
100, 144
100, 144
100, 144
100, 144
100, 144
6
1
4
4
2
4
4
4
4
6
3
9
9
9
3
1
9
5
9
5
12
Total number of devices: 113
PROPERTIES
On passing, 'Finish' button:
On failing, 'Finish' button:
Allow user to leave quiz:
User may view slides after quiz:
User may attempt quiz:
Goes to Next Slide
Goes to Slide
At any time
After passing quiz
Unlimited times
CPU Core Comparison
CPU Core
M16C/60
M32C/80
Address Space
1MB
16MB
DMA
2ch
4ch
DMA-II
No
Yes
16-bit
32-bit
No
Yes
Calculation
Instruction
Barrel Shifter
Series
Maximum
Operating
Frequency
Maximum
On-Chip Memory
External Bus
Expansion
10
R8C/Tiny
M16C/Tiny
M16C/6N
M32C/80
20MHz
16MHz,
20MHz
24MHz
32MHz
64KB
128KB
512KB
1MB
No
No
Yes
Yes
© 2009, Renesas Technology America, Inc., All Rights Reserved
Overview of R8C/Tiny CAN MCUs
11
CPU core
16-bit M16C
Architecture
General register
Direct address space
64KB
Instructions
89
Internal clock speed
Up to 20MHz
Instruction execution
50ns (min.)
Multiply (16-bit)
0.25µs
Divide
0.9µs (S/W)
Flash memory
Up to 64KB (+2KB)
Supply voltage
2.7V to 5.5V
Package
48-pin LQFP
On-chip functions
• CAN: 1 channel, 16 mailboxes
• Clock-stop detect
• R-C oscillator
• Versatile multifunction timers
• Watchdog timer
• POR and LVD
• High-sink I/O
• EMC protection
• 8/16-bit timers (IC/OC, PWM)
• 12ch 10-bit A/D
• SCI SSU (SPI) and I2C
• Single-voltage flash with
protect function
• In-circuit programming and
debugging
© 2009, Renesas Technology America, Inc., All Rights Reserved
Features of R8C/22 & 23 Groups
 M16C CPU Core (16-bit)
 3.0-5.5V: 20MHz; 2.7-5.5V: 10MHz
 Flash ROM/RAM
 32KB/2KB; 48KB/2.5KB; 64KB/3KB
 R8C/23: 1KBx2 blocks data flash
 Full CAN (2.0B)
 One channel with 16 message buffers
 Clock generation circuit
 Xin/Xout main clock with stop-detection
 40MHz hi-speed /low-speed on-chip oscillator
 Timers
M16C 16-bit
CPU Core
Flash ROM
(20MHz @ 5V)
(up to 3KB)
Oscillation
Circuit
High-speed Onchip Oscillator
(main clock)
(40MHz)
Low-speed
On-chip
Oscillator
Timer RA
Timer RB
(8 bit with
8-bit prescaler)
(8 bit with
8-bit prescaler)
(16 bit; input capture
output-compare)
A/D
Converter
CAN
Timer RE
(10-bit, 12ch)
 Three 8-bit timers (RA, RB, RE)
 Two channels of 16-bit timer (RD)
 15-bit watchdog timer with H/W reset
 Serial I/O
 Async/Sync communication – 1 channel
RAM
(up to 64KB)
[R8C/23: 2 x 1KB
blocks of Data Flash]
Serial I/O
(1ch, 16 slots)
(8 bit;
compare-match)
Watchdog
Timer
OscillationStop
Detection
(Clock synchronous/
UART)
(15 bit; H/W reset)
Serial I/O
I2C Bus/SSU
(UART)
Timer RD
H/W LIN
(Timer RA + UART)
 UART – 1 channel
 I2C/bus/SSU – 1 channel
LVD
POR
(2 circuits)
 H/W LIN – Uses UART + timer RA
 A/D Converter
48-pin LQFP (7mm x 7mm)
 10-bit, 8-channel
12
I/O Ports
(41 + 3 input-only)
© 2009, Renesas Technology America, Inc., All Rights Reserved
Overview of M16C/Tiny CAN MCUs
CPU core
16-bit M16C
Architecture
General register
Direct address space
1MB
Instructions
91
Internal clock speed
Up to 20MHz
Instruction execution
50ns (min.)
Multiply (16-bit)
0.25µs
Divide
0.9µs (S/W)
Flash memory
Up to 128KB (+4KB)
Supply voltage
2.7V to 5.5V
Packages
64-pin LQFP
80-pin LQFP
On-chip functions*
• CAN: 1 channel, 16 mailboxes
• Four clock circuits; stop-detection
• 3-phase inverter control circuit
• Watchdog timer
• 16-bit Multiplier
• CRC circuit
• Low-voltage detection
• EMC protection
• 16 or 27ch 10-bit A/D converter
• Multiple communication interfaces
• Input-capture/Output-compare
• Single-voltage flash with protect
• In-circuit programming/debugging
* M16C/29 group
13
© 2009, Renesas Technology America, Inc., All Rights Reserved
Features of M16C/29 Group
 M16C CPU Core (16-bit)
 3.0-5.5V: 20MHz; 2.7-5.5V: 10MHz
 Flash ROM/RAM
M16C 16-bit
CPU Core
(20MHz @ 5V)
 96KB/8KB; 128KB/12KB; 64KB/3KB
 2x2KB blocks data flash
 FullCAN (2.0B)
Flash ROM
(up to 128KB with
protect function, plus
2 x 2KB data flash)
16-bit
Multiplier
Real-time
Clock
Timer A
Timer B
(16-bit, 5ch)
(16-bit, 3ch)
A/D
Converter
CAN
DMAC
(1ch, 16 slots)
(2ch)
(32kHz)
 One channel with 16 slots
 CRC
 Clocks
 4 circuits: Xin/Xout main clock with
stop-detection, Xcin (to 50MHz),
on-chip oscillator, PLL
 Timers
 5+3 channels of 16-bit timers (A, B)
 Watchdog timer
 Serial I/O
 Sync/UART – 1 channel
 Sync – 1 channel
 I2C/bus – 1channel
 Multi-master I2C – 1channel
 Smart card interface
 A/D Converter
 10-bit, 16 or 27 channels
RAM
(up to 12KB)
(10-bit,16 or 27ch)
Watchdog
Timer
Serial I/O
On-chip
Oscillator PLL
PWM
(16-bit; input capture
output-compare)
CRC
Input-capture
Output-compare
(Clock synchronous/
UART, x 3ch)
(15 bit; H/W reset)
Serial I/O
Multi-master I2C
(Clock synch,,
x 2ch or x 1ch)
SIO/UART
(I2C/IEBus, x 1ch)
Interrupt
ROM
Correction
LVD
I/O Ports
(55 or 71)
64-pin (10mm x 10mm) or 80-pin (12mm x 12mm) LQFP
I2C-bus is a registered trademark of Philips. IEBus is a trademark of NEC Electronics.
14
© 2009, Renesas Technology America, Inc., All Rights Reserved
PROPERTIES
On passing, 'Finish' button:
On failing, 'Finish' button:
Allow user to leave quiz:
User may view slides after quiz:
User may attempt quiz:
Goes to Next Slide
Goes to Slide
At any time
After passing quiz
Unlimited times
Overview of M16C/6N CAN MCUs
16
CPU core
16-bit M16C
Architecture
General register
Direct address space
1MB
Instructions
91
Internal clock speed
Up to 24MHz
Instruction execution
41.7ns (min.)
Multiply (16-bit)
0.21µs
Divide
0.75µs (S/W)
Flash memory
Up to 512KB
Supply voltage
3.0V to 5.5V
Packages
100-pin LQFP
128-pin LQFP
On-chip functions
• CAN: 1 or 2 channels,
16 mailboxes in each channel
• Four clock circuits; stop-detection
• 3-phase inverter control circuit
• Watchdog timer
• 16-bit Multiplier
• CRC circuit
• EMC protection
• 26ch 10-bit A/D converter
• 2ch 8-bit D/A converter
• Multiple communication interfaces
• Flash with protect or mask ROM
• In-circuit programming/debugging
© 2009, Renesas Technology America, Inc., All Rights Reserved
Features of M16C/6N Series
 M16C CPU Core (16-bit)
M16C 16-bit
CPU Core
 3.0-5.5V: 24MHz
 Flash ROM/RAM
(24MHz @ 5V)
 128-512KB Flash, 5-31KB RAM
 2x2KB blocks data flash
 FullCAN (2.0B)
Mask/Flash ROM
(up to 512KB, protect;
2 x 2KB data flash
on some versions)
RAM
(up to 31KB)
16-bit
Multiplier
Real-time
Clock
(32kHz)
On-chip
Oscillator
Timer A
(16-bit, 5ch)
Timer B
(16-bit, 6ch)
PWM
A/D
Converter
(10-bit 26ch)
CAN
(1 or 2ch,
16 slots each)
DMAC
(2ch)
D/A
Converter
(8-bit 2ch)
Watchdog
Timer
PLL
SIO/UART
Interrupt
 2 channels (M16C/6N4, M16C6NK)
 1 channel (M16C/6N5, M16C6NL)
 CRC
 Clocks
 4 circuits: Xin/Xout main clock with
stop-detection, Xcin (to 50MHz),
on-chip oscillator, PLL
 Timers
 5+3 channels of 16-bit timers (A, B)
 Watchdog timer
 Serial I/O
 Clock Synchronous + UART +
I2C Bus + IEbus – 1 channel
 Clock Sync. only – 1 channel
 Data Converters
 10-bit, 26ch A/D; 8-bit, 2ch D/A
17
Serial I/O
(Clock synch,
x 2ch or x 4ch)
(I2C/IEBus, x 3ch)
ROM
Correction
CRC
I/O Ports
(87 or 113)
100-pin (14mm x 14mm), 128-pin (14mm x 20mm) LQFP
© 2009, Renesas Technology America, Inc., All Rights Reserved
Overview of M32C CAN MCUs
CPU core
16/32-bit M32C
Architecture
General register
Direct address space
16MB
Instructions
108*
Internal clock speed
Up to 32MHz
Instruction execution
31.2ns (min.)
Multiply (16-bit)
0.16µs
Divide
0.56µs (S/W)
Flash memory
Up to 1024KB
Supply voltage
3.0V to 5.5V
Packages
100-pin LQFP
100-pin QFP
144-pin LQFP
On-chip functions
• CAN: 1 or 2 channels,
16 mailboxes in each channel
• X-Y Converter
• Multiple communication interfaces
• A/D and D/A converters
• Intelligent I/O controller
• Four clock circuits
• 3-phase inverter control circuit
• Watchdog timer
• Multiplier
• CRC circuit
• DMA + DMA-II
• Flash with protect or mask ROM
• LVD
• In-circuit programming/debugging
*Includes 32-bit DSP instructions
18
© 2009, Renesas Technology America, Inc., All Rights Reserved
Features of M32C/80 Series
 M32C CPU Core (16/32-bit)
 4.2-5.5V: 32MHz; 24MHz: 3.0 to 5.5V
 Flash ROM/RAM
 320KB/24KB; 512KB/24KB; 1MB/48KB
 2x2KB blocks data flash
 FullCAN (2.0B)
 1 or 2 channels [3 channels with
cold/warm start-up determine: M32C/88]
 CRC
 Clocks
M32C
16/32-bit
CPU Core
(32MHz @ 5V)
Mask/Flash ROM
(up to 512KB, protect;
2 x 2KB data flash)
[M32C/87: up to 1MB]
Multiplier
Real-time
Clock
Interrupt
(32kHz)
Timer A
(16-bit, 5ch)
(16-bit, 6ch,
IC/OC)
A/D
CAN
(10-bit 26or 34ch)
(1 or 2ch)
[M32C/88: 3ch]
Timer B
 4 circuits
 Timers
 11 channels of 16-bit timers
 Watchdog timer
D/A
 Serial I/O
(8-bit 2ch)
 Sync/UART/I2C/IEbus – 5 or 6 channels
 Data Converters
 10-bit, 26/34ch; 8-bit 2ch D/A
 Intelligent I/O
 X-Y Converter
 2-ph Stepping Motor Controller (M32C/86)
 IrDA and H/W IEBus (M32C/87)
For more details on Renesas CAN MCUs, please visit:
http://america.renesas.com/can
19
X-Y
Converter
SIO/UART
(I2C, IEBus, x 5ch)
[M32C/87: 6ch]
RAM
(up to 31KB)
[M32C/87:
up to 48KB]
On-chip
Oscillator
PLL
3-phase
Inverter Control
DMAC
(2ch)
CRC
DMAC-II
2-ph Stepping
Motor Control
[M32C/86 only]
Watchdog
Timer
Intelligent I/O
Input capture: 8ch; Output compare: 8ch;
Comm. functions [M32C/87: H/W IEBus]
I/O Ports
IrDA
ROM
LVD
(85 or 121; real-time
Correction [M32C/87] [/84 - /87]
ports: M32C/88)
100-pin (14mm x 14mm), 144-pin (20mm x 20mm) LQFP
© 2009, Renesas Technology America, Inc., All Rights Reserved
Network/System Development Tools


CAN 2.0B functions are supported by popular CAN networking tools.
Renesas offers comprehensive embedded system development tools.
M16C CAN-D kit aids learning CAN
networking and MCU evaluation
HEW IDE eases code building/debugging
Workspace
window
Editor window
Output window
 Three target boards
 E8-USB debugger/emulator
 HEW 4 integrated development environment
 Systec Electronics CAN BUS sniffer
 Sample CAN network demo program
 and more
20
 Wizard for easy project set-up
 Fully-featured context-sensitive integrated editor
 Customizable build system
 Hierarchical projects
 Management of tools, versions and upgrades
 Flexible version control interface
 Support for double-byte character sets, external editor
© 2009, Renesas Technology America, Inc., All Rights Reserved
PROPERTIES
On passing, 'Finish' button:
On failing, 'Finish' button:
Allow user to leave quiz:
User may view slides after quiz:
User may attempt quiz:
Goes to Next Slide
Goes to Slide
At any time
After passing quiz
Unlimited times
Course Summary





22
CAN technology
Renesas MCU product lines
Renesas CAN MCUs
R8C/Tiny, M16C/Tiny, M16C/6N, M32C/80 CAN MCUs
Development tools
© 2009, Renesas Technology America, Inc., All Rights Reserved