The offer code shows easy way to control of pwm 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: inverted of Out1 (e.g. Out1=100% Out2=0%) |
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..): PCPWM1try-m328 - Time-Limited trial version (12 hours) then need restart! |
2. uc AtMega2560 (Mega(ATMEGA2560)......): PCPWM1try-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=0 SV02=4) - BE SURE TO DO THIS AFTER UPDATING THE CODE! |
PV01? = Return PV01= set percentage (0-100) |
SV01? - Return value of SV01 = working percentage |
SV02? - Return value of SV02 = selected pwm frequency (see Legend) |
Set-Preset commands: Some or all commands use internal uC EEPROM for memorization when power loss! |
SV01=X - X=Set (working) pwm percentage (0-100% 0=0V 100%=5V) |
SV02=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 |
|