diff --git a/Readme.md b/Readme.md index 7cb54d1..3c31395 100644 --- a/Readme.md +++ b/Readme.md @@ -63,12 +63,33 @@ The output pairs use the dead-band submodule. The two signals must be checked on **Dual-core note:** CPU1 controls cross-CPU ownership selection and shared startup coordination. Independent writes to `TBCLKSYNC` from both programs do not constitute a reliable synchronization protocol. # 4.0 Create a dual CPU project ready for bitfield and driverlib -1. Open a new folder (6-epwm-example); not a workspace +1. Open a new folder (5-epwm-example); not a workspace 2. Import project from `C2000Ware_26_01_00_00`: `driverlib/f2837xd/examples/dual/empty_projects/css` -3. Change project names - - `gpio_bitfield_cpu1` - - `gpio_driverlib_cpu2` -- Change the `.c` files also +3. Change folder/project names + - `pwm_cpu1_bitfield.` + - `pwm_cpu2_driverlib` +4. Change the `.c` files also; follow the same approach +5. Bitfield project needs some additional compilation variables + - Path type var named `C2000_Common` points to `/Users/gmarx/ti/C2000Ware_26_01_00_00/device_support/f2837xd/common/include` + - Path type var named `C2000_Headers` pointing to `/Users/gmarx/ti/C2000Ware_26_01_00_00/device_support/f2837xd/headers/include` +6. Also, in `C2000 Compiler` and `Include Options`, we should add the previously created vars as: + - `${C2000_Common}` + - `${C2000_Headers}` +7. Additionally, at `C2000 Compiler` and `Predefined Symbols`, add the entry: + - `_DUAL_HEADERS` and `_LAUNCHXL_F28379D`. +8. Additional source files must be added from `/Users/gmarx/ti/C2000Ware_26_00_00_00/device_support/f2837xd/common/source`: + - `F2837xD_SysCtrl.c` + - `F2837xD_usDelay.asm` + - `F2837xD_EPwm.c` +9. Add the file `F2837xD_GlobalVariableDefs.c`-data structure to map all peripherals- that is at `/Users/gmarx/ti/C2000Ware_26_00_00_00/device_support/f2837xd/headers/source/F2837xD_GlobalVariableDefs.c` +10. One last file must be included: `F2837xD_Headers_nonBIOS_cpu1.cmd` from the path `/Users/gmarx/ti/C2000Ware_26_00_00_00/device_support/f2837xd/headers/cmd/F2837xD_Headers_nonBIOS_cpu1.cmd` **we are using the nonBIOS option because the code will run in debug mode** +11. However, the CPU2 has an issue at the `Predefined symbols`, we must change the name `CPU1` to `CPU2` + + +- From the 12 PWMs, only 6 are available +- PWM1 (PWM1A and PWM1B) and PWM2 will be used for CPU1 +- PWM4 and PWM5 will be used for CPU2 +![](pinout.jpg) # 4. Start from an almost-empty CPU1 program (bit-field approach) @@ -99,6 +120,8 @@ void main(void) The following sections progressively fill in these steps. Register names are those used in the **provided source**. +**Note: we are in video part 2** + ## 5. CPU1: system initialization and peripheral ownership The provided source initializes the system and interrupt tables: diff --git a/pinout.jpg b/pinout.jpg new file mode 100644 index 0000000..91062ee Binary files /dev/null and b/pinout.jpg differ