cp3cn23 National Semiconductor Corporation, cp3cn23 Datasheet - Page 163
![no-image](/images/no-image-200.jpg)
cp3cn23
Manufacturer Part Number
cp3cn23
Description
Cp3cn23 Reprogrammable Connectivity Processor With Dual Can Interfaces
Manufacturer
National Semiconductor Corporation
Datasheet
1.CP3CN23.pdf
(246 pages)
- Current page: 163 of 246
- Download datasheet (3Mb)
22.4.1
A Bus Error (BER) may occur during a write transaction if
the data register is written at a very specific time. The mod-
ule generates one system-clock cycle setup time of SDA to
SCL vs. the minimum time of the clock divider ratio.
The problem can be masked within the driver by dynamical-
ly dividing-by-half the SCL width immediately after the slave
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
; NAME: ACBRead
;
;
;
;
;
; PARAMETERS:
;
;
;
;
; CALLS:
;
; RETURNED: error status
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
UWORD
{
KBD_OUT &= ~BIT0;
KBD_OUT &= ~BIT0;
KBD_OUT &= ~BIT0;
//
ACB_T
UBYTE
UWORD
acb =
if (Addrs != NextAddress) {
KeyInit();
}
if ((err = ACBStartX (Slave | (Addrs >> 7 & 0x0E), ACB_READ, Count)))
rcv =
while (Count) {
}
KBD_OUT &= ~BIT0;
ACBRead (UBYTE Slave, UWORD Addrs, UWORD Count, UBYTE *buf)
NextAddress =
if ((err = ACBStartX (Slave | (Addrs >> 7 & 0x0E), ACB_WRITE, 0)))
acb->ACBsda =
Timeout =
while (!(acb->ACBst & ACBSDAST) && !(acb->ACBst & ACBBER) && Timeout--);
if (acb->ACBst & ACBBER) {
}
if (!Timeout)
return (err);
if (Count-- == 1)
Timeout =
while (!(acb->ACBst & ACBSDAST) && Timeout--);
if (!Timeout)
*rcv++
NextAddress++;
Avoiding Bus Error During Write Transaction
ACBStartX
*acb;
err, *rcv;
Timeout;
(ACB_T*)ACB_ADDRESS;
return (err);
acb->ACBst
return (ACBERR_COLLISION);
return (ACBERR_TIMEOUT);
buf;
acb->ACBctl1
return (ACBERR_TIMEOUT);
UBYTE
UWORD
UWORD
UBYTE
=
Reads "Count" byte(s) from selected I2C Slave.
Read or Write operation (as recorded in NextAddress), a "dummy" write transaction is
initiated to reset the address to the desired location.
Start sequence and the Read transaction.
which sends the Start condition and Slave address.
1000;
1000;
acb->ACBsda;
Slave
Addrs
Count
*buf
Addrs;
(UBYTE)Addrs;
|=
ACBBER;
|=
-
-
-
-
ACBACK;
Slave Device Address. Must be of format 0xXXXX0000
Byte/Array address (extended addressing mode uses two byte address)
Number of bytes to read
Pointer to receive buffer
/* Set pointer to ACB module
/* If the indicated address differs from the last
/* recorded access (i.e. Random Read), we must first
/* send a "dummy" write to the desired new address..
/* Update last address placeholder
/* Send start bit and Slave address...
/* If unsuccessful, return error code
/* Send new address byte
/* Set timeout
/* Wait for xmitter to be ready...zzzzzzzzz
/* If a bus error occurs while sending address, clear
/* the error flag and return error status
/* If we timeout, return error
/* (Re)Send start bit and Slave address...
/* If error, return
/* Get address of read buffer
/* Read Count bytes into user’s buffer
/* If this the final byte, or only one requested, send
/* the NACK bit after reception
/* Set timeout
/* Timed out??
/* YES - return error
/* NO - Read byte from Recv register
/* Adjust current address placeholder
163
address is successfully sent and before writing to the ACB-
SDA register. This has the effect of forcing SCL into the
stretch state.
The following code example is the relevant segment of the
ACCESS.bus driver addressing this issue.
All transactions begin with a call to ACBStartX
If read address differs from previous
Checks for errors throughout process.
This is followed by a repeated
www.national.com
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
*/
Related parts for cp3cn23
Image
Part Number
Description
Manufacturer
Datasheet
Request
R
![mma1270keg](/images/no-image3.png)
Part Number:
Description:
Freescale Semiconductor Technical Data
Manufacturer:
National Semiconductor Corporation
Datasheet:
![ADC12034](/images/no-image3.png)
Part Number:
Description:
Self-calibrating 12-bit Plus Sign Serial I/o A/d Converters With Mux And Sample/hold
Manufacturer:
National Semiconductor Corporation
Datasheet:
![LMX2350](/images/no-image3.png)
Part Number:
Description:
Pllatinum Tm Fractional N Rf / Integer N If Dual Low Power Frequency Synthesizer
Manufacturer:
National Semiconductor Corporation
Datasheet:
![LMX2324](/images/no-image3.png)
Part Number:
Description:
Pllatinum? 2.0 Ghz Frequency Synthesizer For Rf Personal Communications
Manufacturer:
National Semiconductor Corporation
Datasheet:
![LMX2301](/images/no-image3.png)
Part Number:
Description:
Pllatinumtm 160 Mhz Frequency Synthesizer For Rf Personal Communications
Manufacturer:
National Semiconductor Corporation
Datasheet:
![NDS8963](/images/no-image3.png)
Part Number:
Description:
Dual N-channel Enhancement Mode Field Effect Transistor
Manufacturer:
National Semiconductor Corporation
Datasheet:
![LM1201](/images/no-image3.png)
Part Number:
Description:
Video Amplifier System (obsolete)
Manufacturer:
National Semiconductor Corporation
Datasheet:
![LM3501TL-16](/images/no-image3.png)
Part Number:
Description:
Synchronous Step-up DC/DC Converter For White Led Applications
Manufacturer:
National Semiconductor Corporation
Datasheet:
![AD9621](/images/no-image3.png)
Part Number:
Description:
CLC420 - High Speed, Voltage Feedback op Amp, Package: Lcc, Pin Nb=20
Manufacturer:
National Semiconductor Corporation
Datasheet:
![LM2403](/images/no-image3.png)
Part Number:
Description:
Monolithic Triple 4.5 CRT Driver
Manufacturer:
National Semiconductor Corporation
Datasheet:
![LM592M](/images/no-image3.png)
Part Number:
Description:
Differential Video Amplifier
Manufacturer:
National Semiconductor Corporation
Datasheet:
![ADC10061](/images/no-image3.png)
Part Number:
Description:
ADC10061 - 10-Bit 600 NS A/D Converter With Input Multiplexer And Sample/Hold, Package: Soic Wide, Pin Nb=20
Manufacturer:
National Semiconductor Corporation
Datasheet:
![DS36277TMX](/images/no-image3.png)
Part Number:
Description:
DS36277 - Dominant Mode Multipoint Transceiver, Package: Soic Narrow, Pin Nb=8
Manufacturer:
National Semiconductor Corporation
Datasheet:
![DS3654](/images/no-image3.png)
Part Number:
Description:
Printer Solenoid Driver
Manufacturer:
National Semiconductor Corporation
Datasheet:
![DS3662](/images/no-image3.png)
Part Number:
Description:
Quad High Speed Trapezoidal Bus Transceiver
Manufacturer:
National Semiconductor Corporation
Datasheet: