Creating a New Target - GaryA/antweight-esc GitHub Wiki
Creating a build for a new target (ESC) is designed to be very simple.
The most complicated part is figuring out the connections between the microcontroller and the rest of the circuit, and the polarity of the FET drive signals. This needs to be done very carefully in order to avoid potentially destroying a board. Once the circuit has been discovered a new target can be created.
- In uVision, go to
Project->Manage->Components, Environment, Books... - In the
Project Targetscolumn, add a new target named as the board that it supports, capitalised with no spaces. For example,HobbyWing FlyFun 6AbecomesHobbyWingFlyFun6A. - Click
Set as Current TargetthenOK. - Create a new folder in the
Targetsfolder with the same name as the target<TargetName> - Copy the file
board.hfrom theTargets\Genericfolder and place it in the new folder. - In uVision, go to
Project->Options for Target...and select theC51tab. - Set
Include Pathsto.\Targets\<TargetName> - Select the
Outputtab and click onSelect Folder for Objects.... Select theTargets\<TargetName>folder and click OK. - In
Name of Executableenter the target name and click OK. - Ensure that the correct
board.hfile is open in the editor, the safest method is to closeboard.hif it is open then re-open it from the project browser. - Edit the definitions in the
board.hfile to match the pin mappings of the board, taking account of any inversions in the polarity of the FET drive outputs. If dMOTOR_x_xx_POL is set to 1 a logic 1 will turn the corresponding FET on. - Building the code will result in a .hex file stored as
Targets\<TargetName>\<TargetNem>.hex