Electronic Components Datasheet Search
  English  ▼

X  

CP3UB26 Datasheet(PDF) 183 Page - National Semiconductor (TI)

[Old version datasheet] Texas Instruments acquired National semiconductor.
Part # CP3UB26
Description  Reprogrammable Connectivity Processor with USB and CAN Interfaces
PDF  268 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  NSC [National Semiconductor (TI)]
Direct Link  http://www.national.com
Logo NSC - National Semiconductor (TI)

CP3UB26 Datasheet(HTML) 183 Page - National Semiconductor (TI)

Back Button CP3UB26 Datasheet HTML 179Page - National Semiconductor (TI) CP3UB26 Datasheet HTML 180Page - National Semiconductor (TI) CP3UB26 Datasheet HTML 181Page - National Semiconductor (TI) CP3UB26 Datasheet HTML 182Page - National Semiconductor (TI) CP3UB26 Datasheet HTML 183Page - National Semiconductor (TI) CP3UB26 Datasheet HTML 184Page - National Semiconductor (TI) CP3UB26 Datasheet HTML 185Page - National Semiconductor (TI) CP3UB26 Datasheet HTML 186Page - National Semiconductor (TI) CP3UB26 Datasheet HTML 187Page - National Semiconductor (TI) Next Button
Zoom Inzoom in Zoom Outzoom out
 183 / 268 page
background image
183
www.national.com
acb->ACBctl1
|=
ACBSTOP;
/* Send STOP bit
*/
/* Return success status....
*/
return (ACB_NOERR);
}
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
; NAME: ACBStartX
Initiates an ACB bus transaction by sending the Start bit, followed by the Slave address
;
and R/W flag.
Checks for any ACB errors throughout this sequence and returns status.
;
; PARAMETERS:
UBYTE
Slave
-
I2C address of Slave device
;
UBYTE
R_nW
-
Read/Write flag (0x01 or 0x00)
;
UWORD
Count
-
Desired number of bytes (read/write)
;
; CALLS:
;
; RETURNED: error/success
;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
UWORD
ACBStartX (UBYTE Slave, UBYTE R_nW, UWORD Count)
{
ACB_T
*acb;
UWORD
Timeout;
/* Get address of ACB module
*/
acb =
(ACB_T*)ACB_ADDRESS;
/* If Bus is Busy and we’re NOT the Master, return err
*/
if (acb->ACBcst & ACBBB && !(acb->ACBst & ACBMASTER))
return (ACBERR_NOTMASTER);
/* If we’re good to go, send Start condition
*/
acb->ACBctl1
|=
ACBSTART;
/* Check if we’re the Bus Master with timeout
*/
Timeout =
100;
while (!(acb->ACBst & ACBSDAST) && Timeout--)
/* Related to bus error problem
*/
{
if (acb->ACBst & ACBBER) {
/* If collision occurs, clear error and return status
*/
acb->ACBst
|=
ACBBER;
return (ACBERR_COLLISION);
}
}
if (!Timeout)
/* If timeout, we must NOT be the Master...signal error */
return (ACBERR_NOTMASTER);
/* Now, send the address and R/W flag...
*/
acb->ACBsda =
Slave | R_nW;
/* Send address and R/W flag
*/
Timeout =
1000;
/* Failsafe for lockup
*/
/* Wait for address to be sent and ACK’d
*/
while (!(acb->ACBst & ACBSDAST) &&
!(acb->ACBst & ACBNEGACK)&&
--Timeout) {
if (acb->ACBst & ACBBER) {
/* If a bus error occurs while sending address, clear
*/
acb->ACBst
|=
ACBBER;
/* the error flag and return error status
*/
return (ACBERR_COLLISION);
}
}
KBD_OUT |= BIT0; // OScope marker
if (!Timeout)
/* If timeout, signal error
*/
return (ACBERR_TIMEOUT);
/* Or if Slave does not reply, report busy/error
*/
else if (acb->ACBst & ACBNEGACK)
return (ACBERR_NEGACK);
/* Otherwise return success
*/
else {
return (ACB_NOERR);
}



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com