Mikroelektronika MIKROE-442 Datenbogen
![Mikroelektronika](https://files.manualsbrain.com/attachments/e0529b3b58069a916ad7bb89f7e9f5f0eda73421/common/fit/150/50/1b07b99aa3112e022a916b06db07f1f4f211e91d41878452d87c7638b1bf/brand_logo.gif)
mikroBasic PRO for dsPIC30/33 and PIC24
MikroElektronika
319
HW Connection
Example of interfacing ECAN transceiver with MCU and bus
EEPROM Library
EEPROM data memory is available with a number of dsPIC30 family and some PIC24 family MCU’s. The mikroBasic
PRO for dsPIC30/33 and PIC24 includes a library for comfortable work with MCU’s internal EEPROM.
Important: Only 24F04KA201 and 24F16KA102 of PIC24 family of MCUs have EEPROM memory.
Library Routines
- EEPROM_Erase
- EEPROM_Erase_Block
- EEPROM_Read
- EEPROM_Write
- EEPROM_Write_Block
while TRUE
Msg_Rcvd = ECAN1Read(Rx_ID, RxTx_Data, Rx_Data_Len, Can_Rcv_Flags) ‘ receive
message
if ((Rx_ID = ID_1st) and (Msg_Rcvd <> 0) <> 0) then ‘ if message received check id
PORTB = RxTx_Data[0] ‘ id correct, output data at PORTB
Inc(RxTx_Data[0]) ‘ increment received data
ECAN1Write(ID_2nd, RxTx_Data, 1, Can_Send_Flags) ‘ send incremented data back
end if
wend
end.