| 전자부품 데이터시트 검색엔진 |
|
AN1105 데이터시트(PDF) 35 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN1105 데이터시트(HTML) 35 Page - STMicroelectronics |
|
35 / 100 page ![]() 35/100 ST7 pCAN PERIPHERAL DRIVER CAN_Transmit_Request(&periodic_transmission); } //We have given a transmission order here, that will be called on every //timer IT if the message is not already in the transmission queue. //The data is filled each time with the value of the A/D converter data //register. For info. about the ADC, please see the datasheet. } IMPORTANT: Please note that WHEN USED OUTSIDE AN INTERRUPT ROUTINE, AND ONLY THEN, the transmission request MUST NOT BE INTERRUPTED. So, disable all ITs before a function call (SIM) and re-enable them afterwards (RIM) in the last step of the main.c file. In the adc.c file, enter also the following code: In the ADC_Init routine: ADCCSR=0x20;//Starts the ADC peripheral and write a function: u8 ADC_Get(u8 channel) { ADCCSR |= channel; return ADCDR; } Our application is almost entirely written now. Our last step is to fill the main.c file, to allow the entire program to run. At the beginning of the file add: #include “lib.h“ #include “adc.h“ #include “tima.h“ #include “can.h“ #include “can_custom.h” Then complete the main function as follows: void main(void) { _asm(“SIM”); //Disable interrupts /* ----------------------------- */ /*------------------- I N I T I A L I S A T I O N -------------------------*/ /* ----------------------------- */ |
|
링크 URL |
| ALLDATASHEET 가 귀하에 도움이 되셨나요? [ DONATE ] |
Alldatasheet는? | 광고문의 | 운영자에게 연락하기 | 개인정보취급방침 | 링크 투 데이터시트 | 링크교환 | 제조사별 검색 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 |