| công cụ tìm kiếm bảng dữ liệu linh kiện điện tử |
|
SH7047F bảng dữ liệu(PDF) 13 Page - Renesas Technology Corp |
|
|
|||||||||||||||||||||||||||||
SH7047F bảng dữ liệu(HTML) 13 Page - Renesas Technology Corp |
|
13 / 85 page ![]() Rev. 1.00, 08/03, page 5 of 74 1.5 Transmission Program Listing /********************************************************************************/ /* HCAN-2 Transmission Program (Example 1) */ /********************************************************************************/ #include <stdio.h> /* Library function header file */ #include <machine.h> /* Library function header file */ #include "SH7047.h" /* Peripheral register definition header file */ /********************************************************************************/ /* Function prototype declarations */ /********************************************************************************/ void t_main(void ); /********************************************************************************/ /* Main routine */ /********************************************************************************/ void t_main(void){ unsigned short *work; /* Clear bit MCR0 */ HCAN_MCR = 0x0000; /* Clear reset request bit */ /* Clear bit IRR0 */ HCAN_IRR = 0x0001; /* Clear reset interrupt flag (to clear, write 1) */ /* Set pins */ PB.PBCR1 = 0x0000; /* Set PB HCAN-2 */ PB.PBCR2 = 0x000F; /* Set PB HCAN-2 */ /* Set bit rate (BCR): bit rate is 250 kbps when φ = 50 MHz */ HCAN_BCR0 = 0x0009; /* BRP=9(10 system clock) */ HCAN_BCR1 = 0x4300; /* TSEG1=4(5tq),TSEG2=3(4tq) */ /* Initialize mailbox */ work = (unsigned short *)0xFFFFB100; do { *work = 0xFFFF; work++; } while(work < (unsigned short *) 0xFFFFB4F4); /* Set MBC */ HCAN_MB1.MC4 = 0x01; /* Set mailbox 1 as for transmission */ /* Set transmission method */ HCAN_MB1.MC0 = 0x5550; /* Select data frame and standard format, set identifier */ HCAN_MB1.MC5 = 0x01; /* Set data length: 1 byte */ /* Set transmission data */ HCAN_MB1.MD7 = 0xAA; /* Set transmission data: 10101010 */ /* Set message transmission wait status */ HCAN_TXPR0 = 0x0002; /* Set mailbox 1 to transmission wait status */ /* Wait for transmission end */ while((HCAN_TXACK0 & 0x0002) != 0x0002); /* Clear transmission end flag */ HCAN_TXACK0 = 0x0002; /* Clear transmission end flag (to clear, write 1) */ while(1); } |
|
Link URL |
| Cho đến nay ALLDATASHEET có giúp ích cho doanh nghiệp của bạn hay không? [ DONATE ] |
Alldatasheet là | Quảng cáo | Liên lạc với chúng tôi | Chính sách bảo mật | Liên kết đến bảng dữ liệu | Trao đổi link | Tìm kiếm theo nhà sản xuất All Rights Reserved©Alldatasheet.com |
| 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 |