| поискавой системы для электроныых деталей |
|
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 |
| Вашему бизинису помогли Аллдатащит? [ DONATE ] |
Что такое Аллдатащит | реклама | контакт | Конфиденциальность | Ссылка на техническое описание | обмен ссыками | поиск по производителю 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 |