Skip to content

Commit

Permalink
ComponentTester-1.52m
Browse files Browse the repository at this point in the history
Signed-off-by: Martin <Ho-Ro@users.noreply.github.com>
  • Loading branch information
Ho-Ro committed May 10, 2024
1 parent 586e81a commit 209274b
Show file tree
Hide file tree
Showing 53 changed files with 2,514 additions and 289 deletions.
422 changes: 422 additions & 0 deletions BH1750.c

Large diffs are not rendered by default.

31 changes: 30 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,39 @@

Change Log for the Component Tester firmware (m-firmware)

(c) 2012-2023 by Markus Reschke
(c) 2012-2024 by Markus Reschke

------------------------------------------------------------------------------

v1.52m 2024-04
- Added quick-check tool for diodes and LEDs (SW_DIODE_LED).
- Support for BH1750VFI ambient light sensor (HW_BH1750).
- Fixed protocol issue for addressing chips in read mode in function
I2C_WriteByte() for bit-bang I2C.
- Fixed scaling error in the voltage divider calculation in T2 of the Self
Test function.
- Option for packed output format of font display for test purposes (
FONT_PACKED).
- Added new font font_8x16_alt_hf.h (FONT_8x16_ALT_HF, thanks to
Feliciano@EEVblog).
- Corrected bitmap for O umlaut in font_8x16_iso8859-2_hf.h (thanks to
Feliciano@EEVblog).
- Fixed data byte issue in I2C_ReadByte() for hardware TWI (reported by
fail@mikrocontroller.net).
- Corrected the colors for 0.1 and 0.01 multipliers in Display_ColorCode() (
reported by chaoslegion@VRTP)
- Option to switch temporarily to auto-hold mode after a component is found (
in continuous mode, UI_AUTOHOLD_FOUND, suggested by Maniaxx@EEVBlog).
- Added option to optimize the interrupt vector table to reduce firmware size
(Makefile: OPTIMIZE_VECTORS, thanks to Viktor Klimkovich).
- Improved UJT detection to exclude potentiometers with a specifc resistance
(3-15 k) and the wiper turned to one end (reported by wandows@EEVblog).
- Fixed issue with return value in DataStorage() (thanks to Viktor
Klimkovich).
- Fixed detection issue of small capacitances which was caused by the newly
added negative zero offset in LargeCap() (reported by Yuriy_K@EEVblog and
Obelix2007@EEVblog).

v1.51m 2023-12
- Changed GetThirdProbe() into convenience function UpdateProbes2() to reduce
firmware size and adapted calls in various other functions (suggested by
Expand Down
33 changes: 32 additions & 1 deletion CHANGES.de
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,41 @@

�nderungen der Component-Tester-Firmware (m-firmware)

(c) 2012-2023 by Markus Reschke
(c) 2012-2024 by Markus Reschke

------------------------------------------------------------------------------

v1.52m 2024-04
- Schnelltest von Dioden und LEDs (SW_DIODE_LED).
- Unterst�tzung vom BH1750VFI Umgebungslichtsensor (HW_BH1750).
- Protokollfehler von IC-Adressierung im Lesemodus in I2C_WriteByte() f�r
Bit-Bang-I2C beseitigt.
- Skalierungsfehler in der Berechnung des Spannungteilers in T2 vom Selbsttest
behoben.
- Option f�r komprimiertes Ausgabeformat bei Testausgabe des Zeichensatzes (
FONT_PACKED).
- Neuer Zeichensatz font_8x16_alt_hf.h (FONT_8x16_ALT_HF, Dank an
Feliciano@EEVblog).
- Bitmap f�r � in font_8x16_iso8859-2_hf.h korrigiert (Dank an
Feliciano@EEVblog).
- Problem mit Datenbyte in I2C_ReadByte() f�r Hardware-TWI beseitigt (
gemeldet von fail@mikrocontroller.net).
- Farben der Multiplikatoren f�r 0,1 und 0,01 in Funktion Display_ColorCode()
korrigiert (gemeldet von chaoslegion@VRTP).
- Option zum tempor�ren Umschalten in den Auto-Hold-Modus nachdem ein Bauteil
erkannt wurde (im kontinuierlichen Modus, UI_AUTOHOLD_FOUND, Vorschlag von
Maniaxx@EEVBlog).
- Optimierungsoption f�r Interruptvektortabelle zum Reduzieren der Firmware-
gr��e (Makefile: OPTIMIZE_VECTORS, Dank an Viktor Klimkovich).
- UJT-Erkennung verbessert, d.h. Potis mit einem bestimmten Wert (3-15 k) und
auf eine Endposition gestellt werden ausgeschlossen (gemeldet von
wandows@EEVblog).
- Problem mit R�ckgabewert in Funktion DataStorage() gel�st (Dank an Viktor
Klimkovich).
- Problem mit der Erkennung von kleinen Kapazit�ten beseitigt. Wurde durch den
neuen negativen Null-Offset in Funktion LargeCap() verursacht (gemeldet von
Yuriy_K@EEVblog und Obelix2007@EEVblog).

v1.51m 2023-12
- Funktion GetThirdProbe() zu Vereinfachungsfunktion UpdateProbes2() ge�ndert
zum Reduzieren der Firmwaregr��e incl. Anpassungen der Aufrufe (Vorschlag
Expand Down
119 changes: 116 additions & 3 deletions Clones
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ Hints:
- Some GM328A have an ST7735 semi-compatible display which won't run with the
standard ST7735 driver. On those modules the level shifter is followed by an
additional IC (U3, some MCU). In this case use the Semi-ST7735 driver.
This display doesn't suppport high SPI clock rates.
- The model with a round PCB uses also an ST7735 semi-compatible display. This
one comes with a level shifter (CD4050) followed by a shift register (
74HC164) and some MCU on the main PCB. The display doesn't support high
Expand Down Expand Up @@ -560,7 +561,7 @@ to

------------------------------------------------------------------------------

Multifunction Tester TC-1 and family (T7) with ATmega324/644
Multifunction Tester TC-1 and family (T7, etc) with ATmega324/644, old variants
- ATmega324 (very poor pin assignment), 16MHz clock
later models may have an ATmega644
- ST7735 color display (bit-bang SPI)
Expand Down Expand Up @@ -697,6 +698,118 @@ Pinout for fixed cap for self-adjustment:

------------------------------------------------------------------------------

Multifunction Tester TC-1 or T7 with ATmega324, newer variant
- ATmega324, 16MHz clock
- ST7735 color display (bit-bang SPI)
- external 2.5V voltage reference (TL431)
- fixed IR receiver module
- boost converter for Zener check
(runs all the time, non-standard voltage divider 100k/12k,
no constant current source, just series resistor)
- fixed adjustment cap
(in case of problems replace MLCC with 220nF film cap)
- powered by Li-Ion cell 3.7V
- connector for serial TTL interface (5V?)
- settings provided by2hry@EEVblog and Feliciano@EEVblog

Hints:
- Purpose of additional MCU (STC15L104W) is unknown.
- In case the tester turns off suddenly after the first probing cycle try to
enable the workaround option PASSIVE_POWER_CTRL.

Hardware Options:
#define HW_ZENER
#define ZENER_DIVIDER_CUSTOM
#define ZENER_R1 100000
#define ZENER_R2 12000
#define ZENER_UNSWITCHED
#define HW_IR_RECEIVER
#define HW_ADJUST_CAP

Optionally:
#define HW_PROBE_ZENER
#define ZENER_VOLTAGE_MIN 500
#define ZENER_VOLTAGE_MAX 25500

Workarounds (if required):
#define PASSIVE_POWER_CTRL /* if tester turns off suddenly */

Power management settings:
#define BAT_DIRECT
#define BAT_OFFSET 0
#define BAT_WEAK 3600
#define BAT_LOW 3400

LCD module:
#define LCD_ST7735 /* display controller ST7735 */
#define LCD_GRAPHIC /* graphic display */
#define LCD_COLOR /* color display */
#define LCD_SPI /* SPI interface */
#define LCD_PORT PORTB /* port data register */
#define LCD_DDR DDRB /* port data direction register */
#define LCD_RES PB4 /* port pin used for /RESX (optional) */
//#define LCD_CS PB? /* port pin used for /CSX (optional) */
#define LCD_DC PB3 /* port pin used for D/CX */
#define LCD_SCL PB7 /* port pin used for SCL */
#define LCD_SDA PB5 /* port pin used for SDA */
#define LCD_DOTS_X 128 /* number of horizontal dots */
#define LCD_DOTS_Y 160 /* number of vertical dots */
#define LCD_OFFSET_X 2 /* enable x offset of 2 or 4 dots */
#define LCD_OFFSET_Y 1 /* enable y offset of 1 or 2 dots */
#define LCD_FLIP_X /* enable horizontal flip */
//#define LCD_FLIP_Y /* enable vertical flip */
//#define LCD_ROTATE /* switch X and Y (rotate by 90�) */
#define LCD_LATE_ON /* turn on LCD after clearing it */
#define FONT_10X16_HF /* 10x16 font */
#define SYMBOLS_30X32_HF /* 30x32 symbols */
#define SPI_BITBANG /* bit-bang SPI */
#define SPI_PORT LCD_PORT /* SPI port data register */
#define SPI_DDR LCD_DDR /* SPI port data direction register */
#define SPI_SCK LCD_SCL /* port pin used for SCK */
#define SPI_MOSI LCD_SDA /* port pin used for MOSI */

Hardware SPI should be also possible.

Pinout for test probes:
#define TP_ZENER PA4 /* test pin with 10:1 voltage divider */
#define TP_REF PA3 /* test pin for 2.5V reference and relay */
#define TP_BAT PA5 /* test pin with 4:1 voltage divider */
#define TP_CAP PA7 /* test pin for self-adjustment cap */

Pinout for probe resistors:
#define R_PORT PORTC /* port data register */
#define R_DDR DDRC /* port data direction register */
#define R_RL_1 PD0 /* Rl (680R) for test pin #1 */
#define R_RH_1 PD1 /* Rh (470k) for test pin #1 */
#define R_RL_2 PD2 /* Rl (680R) for test pin #2 */
#define R_RH_2 PD3 /* Rh (470k) for test pin #2 */
#define R_RL_3 PD4 /* Rl (680R) for test pin #3 */
#define R_RH_3 PD5 /* Rh (470k) for test pin #3 */

Pinout for power control:
#define POWER_PORT PORTD /* port data register */
#define POWER_DDR DDRD /* port data direction register */
#define POWER_CTRL PD7 /* control pin (1: on / 0: off) */

Pinout for test button:
#define BUTTON_PORT PORTB /* port data register */
#define BUTTON_DDR DDRB /* port data direction register */
#define BUTTON_PIN PINB /* port input pins register */
#define TEST_BUTTON PB2 /* test/start push button (low active) */

Pinout for fixed IR detector/decoder:
#define IR_PORT PORTD /* port data register */
#define IR_DDR DDRD /* port data direction register */
#define IR_PIN PIND /* port input pins register */
#define IR_DATA PD3 /* data signal */

Pinout for fixed cap for self-adjustment:
#define ADJUST_PORT PORTC /* port data register */
#define ADJUST_DDR DDRC /* port data direction register */
#define ADJUST_RH PC6 /* Rh (470k) for fixed cap */

------------------------------------------------------------------------------

Multifunction Tester TC-2 with ATmega324/644
- ATmega324 or 644, 16MHz clock
- ST7735 color display (bit-bang SPI)
Expand All @@ -714,8 +827,8 @@ Hints:
modfication needed to run OSHW firmwares.
- PCB labeled 'T7 PLUS V1.2'

Please use the settings for TC-1 (see above), but swap the pins for the
test button and and power control:
Please use the settings for TC-1 (old variants, see above), but swap the pins
for the test button and and power control:
#define POWER_CTRL PD1 /* controls power (1: on / 0: off) */
#define TEST_BUTTON PD2 /* test/start push button (low active) */

Expand Down
13 changes: 7 additions & 6 deletions HD44780.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* - 8 bit parallel interface (not supported)
* - I2C via PCF8574 based backpack (driving 4 bit parallel interface)
*
* (c) 2015-2022 by Markus Reschke
* (c) 2015-2024 by Markus Reschke
*
* ************************************************************************ */

Expand All @@ -31,7 +31,7 @@
* R/W LCD_RW (default: P1)
* E LCD_EN1 (default: P2)
* LED LCD_LED (default: P3)
* - max. clock for PCF8574 I2C: 100kHz (standard mode)
* - I2C clock mode for PCF8574: standard (100kHz)
*/


Expand Down Expand Up @@ -387,12 +387,13 @@ void PCF8574_Write(uint8_t Byte)
{
if (I2C_Start(I2C_START) == I2C_OK) /* start */
{
I2C.Byte = LCD_I2C_ADDR << 1; /* address (7 bit & write) */
I2C.Byte = LCD_I2C_ADDR << 1; /* address (7 bits) & write (0) */

if (I2C_WriteByte(I2C_ADDRESS) == I2C_ACK) /* address slave */
/* send address & write bit, expect ACK from PCF8574 */
if (I2C_WriteByte(I2C_ADDRESS) == I2C_ACK) /* address PCF8574 */
{
I2C.Byte = Byte; /* port pins */
I2C_WriteByte(I2C_DATA); /* send data */
I2C.Byte = Byte; /* set port pins */
I2C_WriteByte(I2C_DATA); /* send data */
}
/* todo: error handling? */
}
Expand Down
Loading

0 comments on commit 209274b

Please sign in to comment.