AT90CAN32 Automotive Atmel Corporation, AT90CAN32 Automotive Datasheet - Page 216

no-image

AT90CAN32 Automotive

Manufacturer Part Number
AT90CAN32 Automotive
Description
Manufacturer
Atmel Corporation

Specifications of AT90CAN32 Automotive

Flash (kbytes)
32 Kbytes
Pin Count
64
Max. Operating Frequency
16 MHz
Cpu
8-bit AVR
# Of Touch Channels
16
Hardware Qtouch Acquisition
No
Max I/o Pins
53
Ext Interrupts
8
Usb Speed
No
Usb Interface
No
Spi
1
Twi (i2c)
1
Uart
2
Can
1
Graphic Lcd
No
Video Decoder
No
Camera Interface
No
Adc Channels
8
Adc Resolution (bits)
10
Adc Speed (ksps)
15
Analog Comparators
1
Resistive Touch Screen
No
Temp. Sensor
No
Crypto Engine
No
Sram (kbytes)
2
Eeprom (bytes)
1024
Self Program Memory
YES
Dram Memory
No
Nand Interface
No
Picopower
No
Temp. Range (deg C)
-40 to 125
I/o Supply Class
2.7 to 5.5
Operating Voltage (vcc)
2.7 to 5.5
Fpu
No
Mpu / Mmu
no / no
Timers
4
Output Compare Channels
8
Input Capture Channels
2
Pwm Channels
7
32khz Rtc
Yes
Calibrated Rc Oscillator
Yes
216
1
2
3
4
5
6
7
Assembly Code Example
ldi
sts
wait1:
lds
sbrs
rjmp
lds
andi
cpi
brne
ldi
sts
ldi
sts
wait2:
lds
sbrs
rjmp
lds
andi
cpi
brne
ldi
sts
ldi
sts
wait3:
lds
sbrs
rjmp
lds
andi
cpi
brne
ldi
sts
AT90CAN32/64/128
r16, (1<<TWINT)|
TWCR, r16
r16,TWCR
r16,TWINT
wait1
r16,TWSR
r16, 0xF8
r16, START
ERROR
r16, SLA_W
TWDR, r16
r16, (1<<TWINT)|
TWCR, r16
r16,TWCR
r16,TWINT
wait2
r16,TWSR
r16, 0xF8
r16, MT_SLA_ACK
ERROR
r16, DATA
TWDR, r16
r16, (1<<TWINT)|
TWCR, r16
r16,TWCR
r16,TWINT
wait3
r16,TWSR
r16, 0xF8
r16, MT_DATA_ACK
ERROR
r16, (1<<TWINT)|
TWCR, r16
(1<<TWSTA)|
(1<<TWEN)
(1<<TWEN)
(1<<TWEN)
(1<<TWEN) |
(1<<TWSTO)
In the following an assembly and C implementation of the example is given. Note that the code
below assumes that several definitions have been made for example by using include-files.
• When the TWINT flag is set, the user must update all TWI Registers with the value relevant
• After all TWI Register updates and other pending application software tasks have been
for the next TWI bus cycle. As an example, TWDR must be loaded with the value to be
transmitted in the next bus cycle.
completed, TWCR is written. When writing TWCR, the TWINT bit should be set. Writing a
one to TWINT clears the flag. The TWI will then commence executing whatever operation
was specified by the TWCR setting.
C Example
TWCR = (1<<TWINT)|
while (!(TWCR & (1<<TWINT)));
if ((TWSR & 0xF8)!= START)
TWDR = SLA_W;
TWCR = (1<<TWINT)|(1<<TWEN);
while (!(TWCR & (1<<TWINT)));
if ((TWSR & 0xF8)!= MT_SLA_ACK)
TWDR = DATA;
TWCR = (1<<TWINT)|(1<<TWEN);
while (!(TWCR & (1<<TWINT)));
if ((TWSR & 0xF8)!=MT_DATA_ACK)
TWCR = (1<<TWINT)|
ERROR();
ERROR();
ERROR();
(1<<TWSTA)|
(1<<TWEN)
(1<<TWEN) |
(1<<TWSTO);
Comments
Send START condition
Wait for TWINT flag set. This indicates that
the START condition has been transmitted
Check value of TWI Status Register. Mask
prescaler bits. If status different from START
go to ERROR
Load SLA_W into TWDR Register. Clear
TWINT bit in TWCR to start transmission of
address
Wait for TWINT flag set. This indicates that
the SLA+W has been transmitted, and
ACK/NACK has been received.
Check value of TWI Status Register. Mask
prescaler bits. If status different from
MT_SLA_ACK go to ERROR
Load DATA into TWDR Register. Clear TWINT
bit in TWCR to start transmission of data
Wait for TWINT flag set. This indicates that
the DATA has been transmitted, and
ACK/NACK has been received.
Check value of TWI Status Register. Mask
prescaler bits. If status different from
MT_DATA_ACK go to ERROR
Transmit STOP condition
7682C–AUTO–04/08

Related parts for AT90CAN32 Automotive