| Electronic Components Datasheet Search |
|
AN1278 Datasheet(PDF) 31 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN1278 Datasheet(HTML) 31 Page - STMicroelectronics |
|
31 / 44 page ![]() 31/44 LIN (LOCAL INTERCONNECT NETWORK) SOLUTIONS scribed in 3.2.2 User interface functions the application is responsible for the initialization and the interrupt routine. Initialization: Firstly, the output compare must be configured: The OCIE flag of the TACR1 register must be set and the defined OC disabled by writing the high byte of the OC1 register. As the applica- tion is not using OC2 it is disabled also in the same way. Secondly, the timer prescaler must be calculated using the equations given in Table 7: 1st test: prescaler=2 (FCPU/prescaler/BAUDRATE)*165= 8000000/2/9600*165=68750 > 65536 doesn’t match 1st test: prescaler=4 (FCPU/prescaler/BAUDRATE)*165= 8000000/4/9600*165=34375 < 65536 match! The prescaler has to be set to 4 which corresponds to writing the value (0,0) in the (CC0,CC1) bits in Timer A Control Register 2. extern uByte master_data[]; void DataReceived_Notification(@tiny t_header *header, @tiny t_response *re- sponse) { if(header->identifier == ID_Table[0].id){ master_data[0]=response->data[0]; master_data[1]=response->data[1]; } else if(header->identifier == ID_Table[2].id){ PORTS_WakeUp_On(); _asm("halt\n"); } } @interrupt void PORTS_0_Interrupt(void) { unsigned char i; i=250; while(i--); if(!(PADR&0xFE)) { PAOR&=0xFE; LIN_SendWakeUpSignal(); } } on-chip SCI used (FCPU/prescaler/BAUDRATE)*165 < 65536 |
|
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 |
| 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 |