The offer code shows easy way to control of 2x pwm outputs from PC screen. |
For Arduino boards: NANO - UNO - MEGA |
Arduino pins are used: see connections (for Mega: D9/D10) |
|
Electrical and practical notes: (Recommendation:Use the following accessories for testing as well as for later use: Lnk1 - Lnk2 ) |
It can be powered only from PC USB but it is recommended to use an external voltage source 9V/1A (on dc plug or on VIN pin). |
On outputs can connect some other type of 5V Loads up to 20 mA (for each output) like LED, PWM drivers (Link1 - Link2 - |
When finishing uploading code, be sure to do a Default Reset (see below) |
|
User guide and explanations: |
Select the PWM frequency depending on the load(s) used. |
PWM Out1: According to user settings - PWM Out2: According to user settings |
The Selected PWM frequency is the same for both PWM outputs! |
The set values remain stored (EEPROM) even after a power failure! |
The code in the board does independently from PC according to the last settings values! |
|
Download the HEX codes below, unpack and upload to the proper Arduino board (Use a free net tool for example XLoader) |
1. uc ATmega328-16MHz (MINI,NANO,UNO..): PCPWM2try-m328 - Time-Limited trial version (12 hours) then need restart! |
2. uc AtMega2560 (Mega(ATMEGA2560)......): PCPWM2try-M2560 - Time-Limited trial version (12 hours) then need restart! |
|
Description of HexCode commands ( You can test the uploaded code using some free serial communication software such as Termite (select: Append CR)): |
AT command (ASCII characters + ENTER) - Baud 9600,8 Data bits, None Parity,1 Stop Bit |
AT - attention command (returns OK) |
I? - software code info (return ucAppName) |
DRESET - Default Reset ( SV01=4 SV11/SV21=0) - BE SURE TO DO THIS AFTER UPDATING THE CODE! |
PV0X? = Return PV0X= set percentageX X=1-2 (0-100) |
SV01? - Return value of SV01 = selected pwm frequency (see Legend) |
SV11? - Return value of SV11 = working percentage of pwm Out1 |
SV21? - Return value of SV21 = working percentage of pwm Out2 |
Set-Preset commands: Some or all commands use internal uC EEPROM for memorization when power loss! |
SV11=X - X=Set (working) pwm Out1 percentage (0-100% 0=0V 100%=5V) |
SV21=X - X=Set (working) pwm Out2 percentage (0-100% 0=0V 100%=5V) |
SV01=X - X=pwm frequency (selection 1-7) |
--- Legend: 1=31372.55Hz 2=3921.16Hz 3=980.39Hz 4=490.20(default) 5=245.10Hz 6=122.55Hz 7=30.64Hz |
|