can to uart converter board v1.0 september...
TRANSCRIPT
CAN-UARTRevv1.0
SKPangElectronicsLtd©2017www.skpang.co.uk
1
Productname CANtoUARTConverterBoard
Modelnumber CAN-UART
Manufacturer SKPangElectronicsLtd
CAN to UART Converter Board
V1.0 September 2017
CAN-UARTRevv1.0
SKPangElectronicsLtd©2017www.skpang.co.uk
2
Contents
TableofContents
1. Introduction............................................................................................................31.1. Features................................................................................................................................................................31.2. CANandPowerConnection.........................................................................................................................41.3. 120ΩTerminator.............................................................................................................................................41.4. UARTConnectionandVoltageSelect.......................................................................................................41.5. RGBLED................................................................................................................................................................5
2. Usage......................................................................................................................5
3. ResettoFactoryDefaults........................................................................................51.6. Procedure.............................................................................................................................................................5
4. BOARDCONFIGURATIONDataFormat....................................................................61.7. UnitConfiguration............................................................................................................................................61.8. Defaults.................................................................................................................................................................7
5. FirmwareUpdate....................................................................................................71.9. UpdateviaCAN..................................................................................................................................................7
CAN-UARTRevv1.0
SKPangElectronicsLtd©2017www.skpang.co.uk
3
1. IntroductionThisboardconversCANmessageintoUARTandviceversa.CANandUARTbaudrateisprogramableviaaCANmessage.TheUARThasastandardpinout.OnboardRGBLEDforstatusindication.FirmwareupgradableviaCAN,UARTorSWD.
1.1. Features• ProgrammableCANbaudrate• ProgrammableUARTbaudrate• RGBLEDstatusindictor• FirmwareupgradableviaCAN,UARTorSWD• SelectableUARTvoltages(3.3vor5v)• 6to18vsupplyvoltagewithreversepolarityprotection• PowerfulARMCortexM3microcontroller• 4UserprogrammableIOpins• CANtoUARTmessageatID0x400+nodeID• UARTtoCANmessageatID0x300+nodeID• CANconfigurationmessageat0x7E5
CAN-UARTRevv1.0
SKPangElectronicsLtd©2017www.skpang.co.uk
4
1.2. CANandPowerConnection
1.3. 120Ω TerminatorThereisa120Ωfittedtotheboard.Tousetheterminatorsoldera2wayheaderpintoJP1theninsertajumper.
1.4. UARTConnectionandVoltageSelect
TheUARTconnectionisviaJ4.TheUARTvoltageisselectableviaJP4,5,6.Solderallbridgesontheleftfor5v.Solderallthebridgesontherightfor3.3v.Photoshown5vbeenselected.
TheCANandpowerareconnectedviaJ3.
CAN-UARTRevv1.0
SKPangElectronicsLtd©2017www.skpang.co.uk
5
1.5. RGBLEDThereisaRGBLEDfittedtotheboard.Thiscolourandfunctionare:
Colour and State Function
Flashing white Booting up
Flashing blue Transmit data
Flashing green Receive data
Solid blue Baudrate changed, waiting for power cycle
Solid red Unit fault
2. UsageTheboardhasafactorydefaultof500kbpsforCANand9600bpsforUART.
OnreceivingUARTmessage,itisbuffereduntil8charactersarereceivedthenitissentoutontheCAN-buswithaCANIDof0x300+nodeID.IfaCR(return)andLF(linefeed)isreceivedbefore8charactersitwillbesentoutstraightaway.
TheboardiswaitingforaCANmessageonCANIDof0x400+nodeID.WhenamessageisreceiveditissentoutontheUARTwiththemessagelengthdeterminedbytheCANmessageDLC.
Forexample:
UARTreceivedmessage
Hello + CR + LF
itwillsentoutontheCAN-bus
48 65 6C 6C 6F 0D 0A
3. ResettoFactoryDefaultsTheboardcanberesettofactorydefaults.
1.6. ProcedureWiththepowerremovedfromtheboard,placeajumperacrossPIO2_13.Poweruptheboard.WaituntiltheLEDisflashingblue.Removethejumperandpowercycletheboard.
CAN-UARTRevv1.0
SKPangElectronicsLtd©2017www.skpang.co.uk
6
4. BOARDCONFIGURATIONDataFormat
1.7. UnitConfigurationCANID
DLC D0 D1 D2 D3 D4 D5 D6 D7
0x7E5 8 NodeID Command Data 00 00 0x7F 0xAA 0x55
D1Command:0x01NewnodeID
0x02CANBaudrate
0x03UARTBaudrate
0x04Reboot
D2Data:
NewnodeIDNodeID(0x01to0x7F)
CANBaudrate 0:125kbps
1:250kbps
2:500kbps(Factorydefault)
3:1000kbps
UARTBaudrate 0:1200
1:2400
2:4800
3:9600(Factorydefault)
4:14400
5:19200
6:28800
7:38400
8:57600
9:115200
CAN-UARTRevv1.0
SKPangElectronicsLtd©2017www.skpang.co.uk
7
1.8. DefaultsTheboardisshippedwiththefollowingdefaults:
CANID:0x0A
CANBaudrate:500kbps
UARTBaudrate:9600bps
5. FirmwareUpdateTheboardfirmwarecanbeupdatedbyserialorCAN.
ToupdateviaCAN,insertajumperonISP_1.ToupdateviaUARTinsertajumperonISP_0.
1.9. UpdateviaCANToupdatethefirmwareviaCAN,aPCAN-USBProfromPeakSystemisrequired.AlsoFlashMagicsoftwarefromEmbeddedSystemsAcademy.EnsurethePCAN-USBProdriverisinstalledandworkingcorrectlyfirst.
Note:ThismethodofupdaterequirestheboardtoberemovedfromanexistingCANnetworkbecauseitoperatesat100kbps.
1. InsertajumperacrossISP_1asshownaboveingreen.2. EnsureterminatorJP1isclosed.3. ConnecttheCANoutputfromPCAN-USBProandpowertotheboardviaJ3.4. StartFlashMagicsoftware.
CAN-UARTRevv1.0
SKPangElectronicsLtd©2017www.skpang.co.uk
8
5. SelectLPC1517CANasthedevice.6. TickthecheckboxEraseblocksusedbyFirmware,Verifyafterprogramming
andFillunusedFlash.7. ClicktheBrowsebuttonandselectnewfirmwarehexfile.8. ClicktheStartbuttonandwait.9. Checkitwhenfinishedwithnoerrors.10. RemovejumperonISP_1andpowercycle.