Compare commits

..

7 Commits
v1.06 ... v1.09

Author SHA1 Message Date
Ben V. Brown
6bbade318d Fix default settings for displaymode to fast 2017-07-07 19:29:15 +10:00
Ben V. Brown
f3156e88dc V1.09 - Add display update mode
Adds the following modes for display update:
Fast (old style)
Slow (1Hz)
Rounded (Only shows to 10C increments)
None (No temp, just symbol)
2017-07-07 19:20:52 +10:00
Ben V. Brown
13603d8db6 Update README.md 2017-06-17 15:47:15 +10:00
Ben V. Brown
551853360c Tested bugfix for menu count being wrong 2017-06-09 21:15:53 +10:00
Adriano
711a3e9182 Update Settings.h (#8)
Options are 7 now.
Fix options menu not showing last option
2017-06-09 21:08:01 +10:00
Ben V. Brown
7e1e81cc6f Adds automatic shutdown
Closes #7 .
Adds shutdown feature with settings entry
2017-05-29 11:07:45 +10:00
Ben V. Brown
a01cb7a4be Update README.md 2017-05-28 20:16:00 +10:00
7 changed files with 116 additions and 23 deletions

View File

@@ -20,15 +20,14 @@ In the latest official firmware they have also added a settings menu system, so
# Upgrading your ts100 iron
This is completely safe, if it goes wrong just put the .hex file from the official website onto the unit and your back to the old firmware. Downloads for the hex files to flash are available on the [releases page.](https://github.com/Ralim/ts100/releases)
**You will need a windows computer (7,8,10 tested), using the normal windows explorer to load the firmware.
The bootloader does not appear to work under mac or linux at the moment.**
Officially the bootloader on the iron only works under windows. However, users have reported that it does work under Mac, and can be made to work under Linux. Details over on the [wiki page](https://github.com/Ralim/ts100/wiki/Upgrading-Firmware).
1. Hold the button closest to the tip, and plug in the USB to the computer.
2. The unit will appear as a USB drive.
3. Drag the .hex file onto the USB drive.
4. The unit will disconnect and reconnect.
5. The filename will have changed to end in .RDY or .ERR .
6. If it ends with .RDY your done! Otherwise something went wrong.
5. The filename will have changed to end in .RDY or .ERR
6. If it ends with .RDY you're done! Otherwise something went wrong.
7. Disconnect the USB and power up the iron. You're good to go.
For the more adventurerous out there, you can also load this firmware onto the device using a SWD programmer.
@@ -51,8 +50,9 @@ The button near the tip cycles through the options, and the one near the usb cha
Note that settings are not saved until you exit the menu, and some settings such as screen flip do not apply until a power cycle is applied.
* UVCO -> Undervoltage cut out level, settable in 1V increments from 10-24V
* STIME -> Sleep time, how long it takes before the unit goes to sleep
* SLTME -> Sleep time, how long it takes before the unit goes to sleep
* STMP -> The temperature the unit drops to in sleep mode
* SHTME -> Shutdown Time, how long the unit will wait after movement before shutting down completely
* MOTION -> Wether motion detection is enabled or not
* TMPUNIT -> Temperature unit, C or F
* FLPDSP -> Flip display for left handed users
@@ -65,6 +65,8 @@ Pressing the button near the iron tip will show the current input voltage. Press
Pressing the button near the usb enters the temperature offset setting menu, when the iron is cold, pressing the other button will start the unit calibrating for any offset in the tip temperature.
# Version Changes:
V1.06
- Changes H and C when the iron is heating to the minidso chevron like images
V1.05
- Adds ability to calibrate the input voltage measurement

View File

@@ -29,14 +29,17 @@ enum {
TEMPCAL, //Cal tip temp offset
} operatingMode;
#define SETTINGSOPTIONSCOUNT 8 /*Number of settings in the settings menu*/
enum {
UVCO = 0,
SLEEP_TEMP,
SLEEP_TIME,
SHUTDOWN_TIME,
MOTIONDETECT,
MOTIONSENSITIVITY,
TEMPDISPLAY,
DISPLAYMODE,
LEFTY,
} settingsPage;

View File

@@ -11,24 +11,29 @@
#define SETTINGS_H_
#include <stdint.h>
#include "stm32f10x_flash.h"
#define SETTINGSVERSION 0x04 /*Change this if you change the struct below to prevent people getting out of sync*/
#define SETTINGSOPTIONSCOUNT 6 /*Number of settings in the settings menu*/
#define MOTION_HIGH (0x00)
#define MOTION_MED (0x10)
#define MOTION_LOW (0x20)
#define SETTINGSVERSION 0x06 /*Change this if you change the struct below to prevent people getting out of sync*/
#define MOTION_HIGH (0x00)
#define MOTION_MED (0x10)
#define MOTION_LOW (0x20)
#define DISPLAYMODE_FAST (0x00)
#define DISPLAYMODE_SLOW (0x01)
#define DISPLAYMODE_ROUND (0x02)
#define DISPLAYMODE_NONE (0x03)
/*
* This struct must be a multiple of 2 bytes as it is saved / restored from flash in uint16_t chunks
*/
struct {
uint32_t SolderingTemp; //current setpoint for the iron
uint32_t SolderingTemp; //current set point for the iron
uint32_t SleepTemp; //temp to drop to in sleep
uint8_t version; //Used to track if a reset is needed on firmware upgrade
uint8_t SleepTime; //minutes timeout to sleep
uint8_t cutoutVoltage:5; //The voltage we cutout at for undervoltage
uint8_t cutoutVoltage:5; //The voltage we cut out at for under voltage
uint8_t movementEnabled:1; //If movement is enabled
uint8_t displayTempInF:1; //If we need to convert the C reading to F
uint8_t flipDisplay:1; //If true we want to invert the display for lefties
uint8_t sensitivity:7; //Sensitivity of accelerometer
uint8_t ShutdownTime:7; //Time until unit shuts down if left alone
uint8_t displayUpdateMode:2; //How fast the display updates / temp showing mode
uint16_t tempCalibration; //Temperature calibration value
uint16_t voltageDiv; //Voltage divisor factor
} systemSettings;

View File

@@ -37,7 +37,7 @@ void setup() {
readIronTemp(systemSettings.tempCalibration, 0,0); //load the default calibration value
Init_Oled(systemSettings.flipDisplay); //Init the OLED display
OLED_DrawString("VER 1.06", 8); //
OLED_DrawString("VER 1.09", 8); //
delayMs(800); //Pause to show version number
Start_Watchdog(1000); //start the system watch dog as 1 second timeout
}

View File

@@ -93,8 +93,10 @@ void ProcessUI() {
settingsPage = 0; //reset
operatingMode = STARTUP; //reset back to the startup
saveSettings(); //Save the settings
} else
} else {
++settingsPage; //move to the next option
}
} else if (Buttons & BUT_B) {
resetLastButtonPress();
//B changes the value selected
@@ -116,9 +118,15 @@ void ProcessUI() {
systemSettings.SleepTime = 1; //cant set time over 30 mins
//Remember that ^ is the time of no movement
break;
case SHUTDOWN_TIME:
++systemSettings.ShutdownTime;
if (systemSettings.ShutdownTime > 60)
systemSettings.ShutdownTime = 0; //wrap to off
break;
case MOTIONDETECT:
systemSettings.movementEnabled =
!systemSettings.movementEnabled;
break;
case TEMPDISPLAY:
systemSettings.displayTempInF = !systemSettings.displayTempInF;
@@ -127,11 +135,17 @@ void ProcessUI() {
systemSettings.flipDisplay = !systemSettings.flipDisplay;
break;
case MOTIONSENSITIVITY:
systemSettings.sensitivity += 0x10;
if (systemSettings.sensitivity > 0x20)
systemSettings.sensitivity = 0; //reset to high on wrap
break;
case DISPLAYMODE:
systemSettings.displayUpdateMode++;
systemSettings.displayUpdateMode =
systemSettings.displayUpdateMode % 4;
break;
default:
break;
}
@@ -142,16 +156,29 @@ void ProcessUI() {
if (Buttons & BUT_A) {
//A Button was pressed so we are moving back to soldering
operatingMode = SOLDERING;
Oled_DisplayOn();
return;
} else if (Buttons & BUT_B) {
//B Button was pressed so we are moving back to soldering
operatingMode = SOLDERING;
Oled_DisplayOn();
return;
} else if (systemSettings.movementEnabled)
if (millis() - getLastMovement() < 1000) {//moved in the last second
operatingMode = SOLDERING; //Goto active mode again
Oled_DisplayOn();
return;
}
if (systemSettings.movementEnabled) {
//Check if we should shutdown
if ((millis() - getLastMovement()
> (systemSettings.ShutdownTime * 60000))
|| (millis() - getLastButtonPress()
> systemSettings.ShutdownTime * 60000)) {
operatingMode = COOLING; //shutdown the tip
Oled_DisplayOn();
}
}
//else if nothing has been pushed we need to compute the PID to keep the iron at the sleep temp
int32_t newOutput = computePID(systemSettings.SleepTemp);
setIronTimer(newOutput);
@@ -270,6 +297,7 @@ void drawTemp(uint16_t temp, uint8_t x) {
* Performs all the OLED drawing for the current operating mode
*/
void DrawUI() {
static uint32_t lastSolderingDrawTime = 0;
uint16_t temp = readIronTemp(0, 0, 0xFFFF);
switch (operatingMode) {
case STARTUP:
@@ -287,26 +315,47 @@ void DrawUI() {
case SOLDERING:
//The user is soldering
{
drawTemp(temp, 0);
OLED_DrawChar(' ', 3);
if (systemSettings.displayUpdateMode == DISPLAYMODE_SLOW
&& (millis() - lastSolderingDrawTime < 1000))
return;
if (systemSettings.displayUpdateMode == DISPLAYMODE_FAST
|| systemSettings.displayUpdateMode == DISPLAYMODE_SLOW) {
drawTemp(temp, 0);
lastSolderingDrawTime = millis();
}
if (systemSettings.displayUpdateMode == DISPLAYMODE_ROUND) {
drawTemp((temp / 100) * 100, 0);
} else if (systemSettings.displayUpdateMode == DISPLAYMODE_NONE) {
OLED_DrawChar(' ', 0);
OLED_DrawChar(' ', 1);
OLED_DrawChar(' ', 2);
}
//Now draw symbols
OLED_DrawChar(' ', 3);
OLED_BlankSlot(6 * 12 + 16, 24 - 16);//blank out the tail after the arrows
OLED_BlankSlot(4 * 12 + 16, 24 - 16);//blank out the tail after the temp
if (getIronTimer() == 0) {
OLED_DrawSymbol(6, 5);
} else {
if (getIronTimer() < 900) {
if (getIronTimer() < 1000) {
OLED_DrawSymbol(6, 7);
} else { //we are heating
//OLED_DrawChar('H', 5);
OLED_DrawSymbol(6, 6);
}
}
if (systemSettings.displayTempInF) {
OLED_DrawSymbol(4, 1);
if (!(systemSettings.displayUpdateMode == DISPLAYMODE_NONE)) {
if (systemSettings.displayTempInF) {
OLED_DrawSymbol(4, 1);
} else {
OLED_DrawSymbol(4, 0);
}
} else {
OLED_DrawSymbol(4, 0);
OLED_DrawChar(' ', 4);
OLED_DrawChar(' ', 5);
}
}
break;
case TEMP_ADJ:
@@ -333,9 +382,13 @@ void DrawUI() {
OLED_DrawThreeNumber(systemSettings.SleepTemp / 10, 5);
break;
case SLEEP_TIME:
OLED_DrawString("STIME ", 6);
OLED_DrawString("SLTME ", 6);
OLED_DrawTwoNumber(systemSettings.SleepTime, 6);
break;
case SHUTDOWN_TIME:
OLED_DrawString("SHTME ", 6);
OLED_DrawTwoNumber(systemSettings.ShutdownTime, 6);
break;
case MOTIONDETECT:/*Toggle the mode*/
if (systemSettings.movementEnabled)
OLED_DrawString("MOTION T", 8);
@@ -372,6 +425,25 @@ void DrawUI() {
break;
}
break;
case DISPLAYMODE:
//We are prompting the user about their display mode preferences
{
switch (systemSettings.displayUpdateMode) {
case DISPLAYMODE_FAST:
OLED_DrawString("DISPMD F", 8);
break;
case DISPLAYMODE_SLOW:
OLED_DrawString("DISPMD S", 8);
break;
case DISPLAYMODE_ROUND:
OLED_DrawString("DISPMD R", 8);
break;
case DISPLAYMODE_NONE:
OLED_DrawString("DISPMD N", 8);
break;
}
}
break;
default:
break;
@@ -382,6 +454,15 @@ void DrawUI() {
//Draw in temp and sleep
OLED_DrawString("SLP", 3);
drawTemp(temp, 4);
if (millis() - getLastMovement() > (10 * 60 * 1000)
&& (millis() - getLastButtonPress() > (10 * 60 * 1000))) {
//OLED off
Oled_DisplayOff();
} else {
Oled_DisplayOn();
}
break;
case COOLING:
//We are warning the user the tip is cooling

View File

@@ -52,5 +52,7 @@ void resetSettings() {
systemSettings.sensitivity=0x00; //Default high sensitivity
systemSettings.tempCalibration=239; //Default to their calibration value
systemSettings.voltageDiv=144; //Default divider from schematic
systemSettings.ShutdownTime=30; //How many minutes until the unit turns itself off
systemSettings.displayUpdateMode=0; //How fast the LCD updates
}

View File

@@ -4,6 +4,6 @@
<name>ts100</name>
<mcuId>stm32f103t8ux</mcuId>
<dbgIF>SWD</dbgIF>
<dbgDEV>ST-LinkV2</dbgDEV>
<dbgDEV>ST-Link</dbgDEV>
</board>
</targetDefinitions>