PIC18C ECAN ‘C’例程
TheEnhancedControllerAreaNetwork(ECAN)mod-
ule,offeredbymanyofthePIC18FfamilyofPICmicro
®
microcontrollers,isthelatestenhancementtotheexist-
inglegacyCANmodule.Devicessuchasthe
PIC18C658/858andPIC18F248/258/448/458usethe
legacyCANmodule.
ECANoffersmanyenhancementsoverthelegacy
CANmoduleintermsofmoretransmit/receivebuffers,
acceptancefilters,andhardwareFIFOoperation.At
thesametime,theECANmoduleisfullybackward
compatiblewiththelegacyCANmodule.
ECANprovidesthreemodesofoperation–Mode0,
Mode1andMode2.Mode0isfullybackwardcompat-
iblewiththelegacyCANmodule.Applicationsdevel-
opedforthelegacyCANmodulewouldcontinueto
workwithoutanychangeusingECAN.Mode1isthe
EnhancedLegacymodewithincreasedbuffersandfil-
ters.Mode2hasthesameresourcesasMode1,but
withahardwaremanagedreceiveFIFO.Givenitsfea-
turesandflexibility,ECANwouldproveusefultomany
CAN-basedapplications.
Thisapplicationnoteimplements‘C’routinestoaccess
allfeaturesoftheECANmodule.Thisdocumentdoes
notdescribeECANandtherelatedPIC18Ffamilyin
detail.Readersareencouragedtoreadthe
PIC18F6585/6680/8585/8680devicedatasheet
(DS30491)formoreinformation.AN878PIC18CECAN‘C’RoutinesAuthors:CaioGübelandNileshRajbhartiOVERVIEWOFECANMODULEMicrochipTechnology,Inc.FollowingarethemainfeaturesoftheECANmodule:FullybackwardcompatiblewiththelegacyCANINTRODUCTIONmoduleThreefunctionalmodes:TheEnhancedControllerAreaNetwork(ECAN)mod--Mode0