-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathREADME
2940 lines (2257 loc) · 111 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
------------------------------------------------------------------------------
ReadMe for the Component Tester firmware (m-firmware)
(c) 2012-2024 by Markus Reschke (madires@theca-tabellaria.de)
------------------------------------------------------------------------------
Last edit: 2024-03-29
Content
- About
- Safety Advice
- License
- Additional Disclaimer
- What's different?
- Source Code
- Supported Hardware
- Building the Firmware
- Busses & Interfaces
- I2C/SPI
- TTL Serial
- OneWire
- Displays
- Fonts and Symbols
- HD44780
- ILI9163
- ILI9341/ILI9342
- ILI9481
- ILI9486
- ILI9488
- PCD8544
- PCF8814
- SH1106
- SSD1306
- ST7036
- ST7565R
- ST7735
- ST7920
- STE2007/HX1230
- VT100 Terminal
- Test push button and other input options
- Test Key
- Rotary Encoder
- Increase/Decrease Buttons
- Touch Screen
- User Interface
- Buzzer
- Communication with PC
- Serial Output
- Automation
- VT100 Output
- Power-On
- Probing
- Battery Monitoring
- Power Off
- Menu
- PWM Tool
- Square Wave Generator
- Zener Tool
- Logic Probe
- Continuity Check
- ESR Tool
- Capacitor Leakage Check
- R/C/L Monitors
- LC Meter
- Frequency Counter
- Basic Counter
- Extended Counter
- Ring Tester
- Event Counter
- Trigger Output
- Rotary Encoder
- Contrast
- IR RC Detector/Decoder
- IR RC Transmitter
- Opto Coupler Tool
- Photodiode Check
- Diode/LED Quick-Check
- Servo Check
- OneWire Scan
- DS18B20/DS18S20 Temperature Sensors
- DHTxx Temperature & Humidity Sensors
- MAX6675/MAX31855 Thermocouple Converters
- BH1750 Ambient Light Sensor
- Flashlight
- Self Test
- Self Adjustment
- Save/Load
- Show Values
- Font/Symbols
- Power Off
- Exit
- Resistors
- Capacitors
- Inductors
- Discharging Components
- ADC Oversampling
- Displaying Results
- Additional Hints
- BJTs
- TRIACs
- CLDs
- Unsupported Components
- Workarounds for some Testers
- Known Issues
- Support
- Change Log
- Remote Commands
- Helpful Links
- References
* About
The Component Tester is based on the project of Markus Frejek [1&2] and the
successor of Karl-Heinz Kübbeler [3&4]. It's an alternative firmware for
Karl-Heinz' current Transistortester circuit and comes with several changes in
the user interface and the methods used for probing and measuring. It also
offers a few additional features. While Karl-Heinz provides an official
release supporting also older ATmega MCUs, this firmware does require an
ATmega with 32kB flash at least.
Hint: Run the self-adjustment for a new tester or if you've done any
modifications, like a firmware update or changing probe leads.
* Safety Advice
The Component Tester is no DMM! It's a simple tester for components capable
of measuring several things. The probes aren't protected in any way and
won't survive higher voltages than 5V. Don't use the tester for live circuits!
Just use it for unsoldered electronic components! If you test a capacitor make
sure it's discharged before connecting the probes. This isn't just the Safety
Sally, your life may be at risk if you connect the probes to a live circuit
or a power supply (or even mains).
* License
The original author hasn't provided any information about the licence under
which the firmware is distributed. He only stated that it's open source and
any commercial user should contact him. Unfortunately we (Karl-Heinz and I)
haven't found any way to contact him. To remedy this problem I've chosen an
open source license at 2016-01-01, after giving the original author more than
sufficient time to tell us his wishes regarding the license. Since the source
code of this firmware version is a major rewrite with tons of new code and
features, I think that this approach is justified.
Licensed under the EUPL v. 1.2
+ Additional Disclaimer
Product or company names are possibly trademarks of the respective owners.
* What's different?
Karl-Heinz has done a really great documentation of the tester. I recommend
to read it. Therefore I'll tell you just about the major differences to the
k-firmware:
- user interface
+ No worries! ;)
+ touch screen
+ remote commands
+ two sets of adjustment values
- adaptive component discharge function
- resistance measurement
+ dedicated method for resistances <10 Ohms (instead of using ESR check)
- capacitance measurement
+ starts at 5pF
+ additional method for caps from 4.7µF up to 47µF
+ correction/compensation method
- no SamplingADC() for very low capacitance or inductance
- diodes
+ detection logic
- BJTs
+ V_f is interpolated for a more suitable (virtual) I_b based on hFE
+ detection of Germanium BJTs with high leakage current
+ detection of Schottky-clamped BJTs
- JFETs
+ detection of JFETs with very low I_DSS
- TRIACs
+ detection of MT1 and MT2
- IR RC detector and decoder
- IR RC transmitter
- opto coupler check
- RC servo check
- OneWire (plus sensors DS18B20 and DS18S20)
- DHTxx Sensors
- event counter
- ring tester (LOPT/FBT tester)
- logic probe
- continuity check
- MAX6675/MAX31855 thermocouple converters
- BH1750 Ambient Light Sensor
- flashlight / general purpose switched output
- structured source code
- simple frameworks for displays and data busses
- some more I couldn't think of right now
There are more details in the sections below.
* Source Code
The first m-firmware was based on Karl-Heinz' source code. A lot of cleaning
up was done, like more remarks, renamed variables, re-structured functions,
large functions splitted up into several smaller ones and what have you. After
that the m-firmware moved on to become an independent version. For example,
simple frameworks for displays and interface busses were added. I hope the
code is easy to read and maintain.
You can download the lastest firmware from following sites:
- https://github.com/madires/Transistortester-Warehouse
- https://github.com/kubi48/TransistorTester-source/tree/master/Markus
(https://github.com/Mikrocontroller-net/transistortester/tree/master/Software/Markus)
* Supported Hardware
The firmware runs on all testers which are compatible with the standard
circuit shown in Karl-Heinz' documentation and which use one of the
following MCUs:
- ATmega 328
- ATmega 324/644/1284
- ATmega 640/1280/2560
You can customize pin assigments if required. The display may be a character
or graphic type (monochrome or color). Please see section 'Displays' for
supported controllers.
Following hardware options are supported:
user interface
- rotary encoder
- additional push buttons (in/decrease)
- touch screen
- serial interface (TTL, RS232, USB-serial adpater)
- buzzer
enhancements
- external 2.5V voltage reference
- fixed adjustment cap
- protection relay for discharging caps
additional checks and measurements
- Zener check / measurement of external voltage <50V
- basic frequency counter
- extended frequency counter
with prescaler and crystal oscillators for low and high frequencies
- fixed IR RC receiver
- LC meter
- ring tester (LOPT/FBT tester)
- logic probe
- MAX6675/MAX31855 thermocouple converters
- flashlight / general purpose switched output
* Building the Firmware
First edit the Makefile to specify your MCU model, frequency, oscilator
type and programmer settings. All other settings are moved to a global
config.h and a MCU specific config-<MCU>.h. The file 'Clones' lists
settings for various tester versions/clones. If you have a tester not listed,
please email the settings to the author to help other users.
In config.h please choose hardware and software options, the language for the
UI, and change any default values if required. All settings and values are
explained in the file, so I won't discuss them here in depth.
Hardware options:
- additional keys
- rotary encoder
- increase/decrease push buttons
- touch screen
- 2.5V voltage reference
- relay based cap discharger
- Zener voltage measurement
- frequency counter (basic and extendend version)
- event counter
- LC Meter
- ring tester (LOPT/FBT tester)
- IR detector/decoder for remote controls
(fixed IR receiver module)
- fixed cap for self-adjustment of voltage offsets
- SPI bus (bit-bang and hardware)
- I2C bus (bit-bang and hardware)
- TTL Serial (bit-bang and hardware)
- OneWire bus (bit-bang)
The external 2.5V voltage reference should be only enabled if it's at least
10 times more precise than the voltage regulator. Otherwise it would make
the results worse. If you're using an MCP1702 with a typical tolerance of
0.4% as voltage regulator you really don't need a 2.5V voltage reference.
And of course the software options:
- PWM generator (2 variants)
- inductance measurement
- ESR measurement and in-circuit ESR measurement
- check for rotary encoders
- squarewave signal generator (requires additional keys)
- IR detector/decoder for remote controls
(IR receiver module connected to probes)
- IR RC transmitter (IR LED with driver transistor)
- check for opto couplers
- servo check (requires additional keys, display with >2 lines)
- detection of UJTs
- capacitor leakage check
- DS18B20/DS18S20 temperature sensors
- color coding for probes (requires color graphics display)
- output of components found also via TTL serial, e.g. to a PC
- remote commands for automation via TTL serial
- output of reverse hFE for BJTs
- DHT11/22 temperature and humidity sensor
- ...
Please choose the options carefully to match your needs and the MCU's
ressources, i.e. RAM, EEPROM and flash memory. If the firmware exceeds the
MCU's flash size, try to disable some options you don't need.
Available UI languages:
- Brazilian Portuguese
- provided by wandows@EEVblog
- Czech
- provided by Kapa
- font based on ISO 8859-1
- Czech 2
- provided by Bohu
- font with Czech characters based on ISO 8859-2
- Danish
- provided by glenndk@mikrocontroller.net
- needs minor changes in the font
- English (default)
- French
- provided by moimem@EEVblog
- German
- Italian
- provided by Gino_09@EEVblog
- Polish
- provided by Szpila
- Romanian
- provided by Dumidan@EEVblog
- Russian
- provided by indman@EEVblog
- font with cyrillic characters based on Windows-1251
- Russian 2
- provided by hapless@@EEVblog
- font with cyrillic characters based on Windows-1251
- alternative text
- Spanish
- provided by pepe10000@EEVblog
For number values a decimal fraction is indicated by a dot, but you can change
that to a comma if you like by enabling the corresponding setting.
For MCU specific settings, like pin assignments and display, edit
config_<MCU>.h:
- ATmega 328 config_328.h
- ATmega 324/644/1284 config_644.h
- ATmega 640/1280/2560 config_1280.h
The display has to provide 2 lines with 16 characters each, at least. For
graphic displays select a font which is small enough to match the
requirements.
After editing the Makefile, config.h and config-<MCU>.h please run 'make' or
whatever toolchain you have to compile the firmware. This will create two
files:
- ComponentTester.hex firmware in Intel hex format
- ComponentTester.eep EEPROM data in Intel hex format
The firmware will be written to the Flash and the EEPROM data to the EEPROM.
The data contains two sets of default adjustment values, texts and tables.
When you update the firmware and like to keep the old adjustment values in the
EEPROM you can enable DATA_FLASH in config.h to move texts and tables into the
firmware. In that case only the firmwmare needs be programed, the EEPROM stays
untouched.
The Makefile provides following additional targets:
- clean to delete all object and firmware files
- fuses to set the ATmega's fuse bits (via avrdude)
- upload to program the firmware and EEPROM data (via avrdude)
- prog_fw to program only the firmware (via avrdude)
- prog_ee to program only the EEPROM data (via avrdude)
Hints on compiler/linker optimizations:
- There are multiple lines of CFLAGS and LDFLAGS with compiler/linker options
in the Makefile. You'll find a few lines commented out which contain
additional optimization options to reduce the firmware size. Those are not
supported by all compilers. So please feel free to experiment. ;)
Hints on special settings in the Makefile:
- In a linux/unix environment you can enable OPTIMIZE_VECTORS to optimize the
interrupt vector table to reduce the firmware size.
* Busses & Interfaces
+ I2C/SPI
Some displays and other hardware might need I2C or SPI for connecting to the
MCU. Therefore the firmware includes drivers for both bus systems. To cope
with different pin assignments of the various testers the bus drivers support
bit-bang and hardware operation modes. The bit-bang mode can use any IO pins
on the same port, while the hardware mode uses the dedicated bus pins of the
MCU. The drawback of the bit-bang mode is its speed, it's slow. The hardware
mode is much faster. You can spot the difference in speeds easily with a high
resolution color LCD module.
For ATmega 328 based testers the bit-bang mode is needed in most cases due to
the circuit. The ATmega 324/644/1284 has more I/O pins and the different pin
assignment for the circuit allows to use the dedicated bus pins for the
hardware mode.
Since SPI or I2C are primarily used by the display module, they can be
configured in the display section of config-<MCU>.h. Alternatively you can
also enable I2C and SPI in config.h, and set ports and pins in dedicated
sections in config-<MCU>.h (look for I2C_PORT or SPI_PORT).
If you select bit-bang SPI and enable the read mode (SPI_RW) please make sure
to set also SPI_PIN and SPI_MISO. See the SPI section in config-<MCU>.h for
an example.
When connecting multiple ICs to the SPI bus, each IC needs to be controlled by
a dediacted /CS signal. Only in the case of one single IC on the SPI bus that
IC's /CS can be tied to ground.
Hint for bit-bang SPI:
- If, in the case of a high MCU clock rate, the SPI bus becomes too fast for
the display please add the option 'SPI_SLOWDOWN' to the display setup in
config-<MCU>.h, or enable it in config.h.
+ TTL Serial
The tester can also provide a TTL serial interface. In case it's used for
communication with a PC it should be combined with a USB to TTL serial
converter or a classic RS-232 driver. The firmware makes use of the MCU's
hardware UART or a bit-bang software UART. The TTL serial interface is enabled
in config.h (see section "Busses") and the port pins are defined in
config-<MCU>.h (look for SERIAL_PORT).
The software UART has the drawback that the TX line will not stay high all
the time when idle. This happens because of the way the MCU port pins are
driven. To remedy this the port pin driving would have to be changed causing
a larger firmware. But this issue doesn't seem to cause any trouble with most
USB to TTL serial converters. In case you see any problem try to add a pull-up
resistor (10-100k) to the TX pin to keep the signal at high level when idle.
The default setting for the TTL serial is 9600 8N1:
- 9600 bps
- 8 data bits
- no parity
- 1 stop bit
- no flow control
+ OneWire
Another supported bus is OneWire which can use either the probes/test pins (
ONEWIRE_PROBES) or a dedicated I/O pin (ONEWIRE_IO_PIN). The driver is designed
for standard bus speed and externally powered clients (not parasitic-
powered).
Pin assignment for probes:
Probe #1: Gnd
Probe #2: DQ (data)
Probe #3: Vcc (current limited by 680 ohms resistor)
An external pull-up resistor of 4.7kOhms between DQ and Vcc is required!
Related tools which require a single client to be connected to the bus can
optionally output the client's ROM code (ONEWIRE_READ_ROM). In case of a CRC
error or if multiple clients are connected the output will be '-'. When the
ROM code is zero there's a read issue. Otherwise the first part of the ROM
code shows the device family and the second part the serial number.
* Displays
At the moment following display controllers are supported:
- HD44780 (character display, 2-4 lines with 16-20 characters)
- ILI9163 (color graphic display 128x160)
- ILI9341/ILI9342 (color graphic display 240x320 or 320x240)
- ILI9481 (color graphic display 320x480, partly untested)
- ILI9486 (color graphic display 320x480, partly untested)
- ILI9488 (color graphic display 320x480, partly untested)
- PCD8544 (graphic display 84x48)
- PCF8814 (graphic display 96x65)
- SH1106 (graphic display 128x64)
- SSD1306 (graphic display 128x64)
- ST7036 (character display, 3 lines with 16 characters, untested)
- ST7565R (graphic display 128x64)
- ST7735 (color graphic display 128x160)
- ST7920 (graphic display up to 256x64)
- STE2007/HX1230 (graphic display 96x68)
- VT100 Terminal (via serial interface)
Take care about the LCD's supply voltage and logic levels! Use a level shifter
if required. A simple level shifter with in-series resistors relying on the
display controller's internal clamping diodes may work, but only for low speed
busses like bit-bang SPI. Therefore I recommend to use proper level shifter
ICs.
To save a few IO pins you can hardwire the /CS and /RES lines via pull-up/down
resistors for nearly all displays and comment out the corresponding IO pins in
the configuration (config_<MCU>.h) as long as the display is the only device
on the interface bus.
If the display doesn't show anything after double checking the wiring, please
try different contrast settings (config_<MCU>.h).
Most graphic displays provide settings to change the image orientation, e.g.
for rotating the image by 90° and mirroring the image horizontally or
vertically. That way the image can be adjusted for each tester as needed.
For color graphic displays additional settings are available. In the normal
color mode the tester uses several colors which can be changed by editing
the colors.h file. By commenting out LCD_COLOR the two-color mode is enabled
and the pen color will be COLOR_PEN, while the background color is set to
COLOR_BACKGROUND. In case the RGB base colors red and blue are reversed
enable LCD_BGR to swap the red and blue color channels. Some displays have
reversed RGB sub-pixels and the display controller doesn't know about that.
Hint for ATmega 328:
If you connect a rotary encoder to PD2/PD3, please connect the display's /CS to
PD5 and set LCD_CS in config_328.h (applies to graphic displays). Otherwise
the rotary encoder would screw up the display by interfering with the data bus.
+ Fonts and Symbols
The display configuration includes also a font and optionally a set of
component symbols. Suitable fonts and symbols are listed for each display in
config_<MCU>.h. For a graphic display you can choose from multiple fonts in
most cases. The symbols are activated by the SW_SYMBOLS switch in config.h.
If you prefer the old style of component symbols you can still use them by
changing the symbols setting to SYMBOLS_<size>_OLD_<format>.h.
For test purposes you can enable a menu function to show all font characters (
SW_FONT_TEST) or all component symbols (SW_SYMBOL_TEST).
Hint:
- When on a color display characters seem to be shifted slightly up or down
based on the color, this is caused by the construction of the display, i.e.
by the positioning of the RGB subpixels.
+ HD44780
The HD44780 is driven in 4 bit mode. The pin assignment for the parallel
port is:
display config-<MCU>.h default remark
ATmega 328
---------------------------------------------------------------
DB4 LCD_DB4 PD0
DB5 LCD_DB5 PD1
DB6 LCD_DB6 PD2
DB7 LCD_DB7 PD3
RS LCD_RS PD4
R/W Gnd
E LCD_EN1 PD5
You can also drive the LCD via a PCF8574 based I2C backpack which requires
I2C to be enabled. The I2C address has to be specified too. The pin
assignment defines how the LCD is connected to the PCF8574:
display config-<MCU>.h default remark
---------------------------------------------------------------
DB4 LCD_DB4 PCF8574_P4
DB5 LCD_DB5 PCF8574_P5
DB6 LCD_DB6 PCF8574_P6
DB7 LCD_DB7 PCF8574_P7
RS LCD_RS PCF8574_P0
R/W LCD_RW PCF8574_P1
E LCD_EN1 PCF8574_P2
LED LCD_LED PCF8574_P3
For a low active backlight please enable LCD_BACKLIGHT_LOW.
+ ILI9163
The ILI9163 is driven by 4-wire SPI. The pin assignment is:
display config-<MCU>.h default remark
ATmega 328
---------------------------------------------------------------
/RESX LCD_RES PD4 optional
/CSX LCD_CS PD5 optional
D/CX LCD_DC PD3
SCL LCD_SCL PD2 SPI clock
SDIO LCD_SDA PD1 SPI MOSI
You might need to play with the x/y flip settings to get the correct
orientation for your display. If necessary you can also offset the x
direction. With LCD_LATE_ON enabled the tester starts with a cleared display
causing a slight delay at power-on. Otherwise you'll see some random pixels
for a moment.
+ ILI9341/ILI9342
The ILI9341/ILI9342 is driven by 4-line SPI or an 8-bit parallel bus. The pin
assignment for 4-line SPI is:
display config-<MCU>.h default remark
ATmega 328
---------------------------------------------------------------
/RES LCD_RES PD4 optional
/CS LCD_CS PD5 optional
D/C LCD_DC PD3
SCK LCD_SCK PD2 SPI clock
SDI LCD_SDI PD1 SPI MOSI
SDO LCD_SDO - ILI9341 only, not used yet
For 8-bit parallel:
display config-<MCU>.h default remark
ATmega 2560
---------------------------------------------------------------
LCD_PORT PORTB
/RESX LCD_RES PB4 optional
/CSX LCD_CS PB5 optional
D/CX LCD_DC PB7
WRX LCD_WR PB0
RDX LCD_RD PB6 optional
LCD_PORT2 PORTL
D0 LCD_DB0 PL0 LCD_PORT2 pin #0
D1 LCD_DB1 PL1 LCD_PORT2 pin #1
D2 LCD_DB2 PL2 LCD_PORT2 pin #2
D3 LCD_DB3 PL3 LCD_PORT2 pin #3
D4 LCD_DB4 PL4 LCD_PORT2 pin #4
D5 LCD_DB5 PL5 LCD_PORT2 pin #5
D6 LCD_DB6 PL6 LCD_PORT2 pin #6
D7 LCD_DB7 PL7 LCD_PORT2 pin #7
You might need to play with the x/y flip and rotate settings to get the
correct orientation for your display. And don't forget to set x and y dots
based on the controller (ILI9341 is 240x320 and ILI9342 is 320x240). Some
display modules disabled the ILI9341's extended command set (EXTC pin
connected to Gnd). In that case you might see a blurry or ghostly output
which can be fixed by enabling LCD_EXT_CMD_OFF.
Based on the relative high number of pixels the display output is somewhat
slow via SPI. A complete screen clear takes about 3 seconds for bit-bang SPI
and an 8MHz MCU clock. Better use harwdare SPI or the parallel bus.
+ ILI9481 (partly untested)
The ILI9481 is driven by an 8-bit parallel bus, 16-bit parallel bus or
4-line SPI.
The pin assignment for 8-bit parallel is:
display config-<MCU>.h default remark
ATmega 2560
---------------------------------------------------------------
LCD_PORT PORTB
/RESX LCD_RES PB4 optional
/CSX LCD_CS PB5 optional
D/CX LCD_DC PB7
WRX LCD_WR PB0
RDX LCD_RD PB6 optional
LCD_PORT2 PORTL
DB0 LCD_DB0 PL0 LCD_PORT2 pin #0
DB1 LCD_DB1 PL1 LCD_PORT2 pin #1
DB2 LCD_DB2 PL2 LCD_PORT2 pin #2
DB3 LCD_DB3 PL3 LCD_PORT2 pin #3
DB4 LCD_DB4 PL4 LCD_PORT2 pin #4
DB5 LCD_DB5 PL5 LCD_PORT2 pin #5
DB6 LCD_DB6 PL6 LCD_PORT2 pin #6
DB7 LCD_DB7 PL7 LCD_PORT2 pin #7
The pin assignment for 16-bit parallel is the same as for 8-bit parallel
and additionally:
LCD_PORT3 PORTC
DB8 LCD_DB8 PC0 LCD_PORT3 pin #0
DB9 LCD_DB9 PC1 LCD_PORT3 pin #1
DB10 LCD_DB10 PC2 LCD_PORT3 pin #2
DB11 LCD_DB11 PC3 LCD_PORT3 pin #3
DB12 LCD_DB12 PC4 LCD_PORT3 pin #4
DB13 LCD_DB13 PC5 LCD_PORT3 pin #5
DB14 LCD_DB14 PC6 LCD_PORT3 pin #6
DB15 LCD_DB15 PC7 LCD_PORT3 pin #7
Pin assignment for 4-line SPI:
display config-<MCU>.h default remark
ATmega 644
---------------------------------------------------------------
/RES LCD_RES PB2 optional
/CS LCD_CS PB4 optional
D/C LCD_DC PB3
SCL LCD_SCL PB7 SPI clock
DIN/SDA LCD_SDA PB5 SPI MOSI
Because of the high resolution of the display and the RGB666 color schema (3
bytes per pixel) SPI is quite slow, even for hardware SPI and a 16 MHz MCU
clock. So I wouldn't recommend to use the SPI interface.
Usually you need to rotate the display (LCD_ROTATE) for correct output.
If neccessary you can also flip X and/or Y.
+ ILI9486 (partly untested)
The ILI9486 is driven by an 8-bit parallel bus, 16-bit parallel bus or
4-line SPI. And it uses the same pin assignment as the ILI9481.
+ ILI9488 (partly untested)
The ILI9488 is driven by an 8-bit parallel bus, 16-bit parallel bus or
4-line SPI. And it uses the same pin assignment as the ILI9481.
+ PCD8544
The PCD8544 is driven by SPI. The pin assignment is:
display config-<MCU>.h default remark
ATmega 328
---------------------------------------------------------------
/RES LCD_RES PD4 optional
/SCE LCD_SCE PD5 optional
D/C LCD_DC PD3
SCL LCD_SCLK PD2 SPI clock
SDIN LCD_SDIN PD1 SPI MOSI
Since the display has just 84 pixels in x direction you'll get 14 chars per
line with a 6x8 font. So up to two chars might be not displayed. To mitigate
that you could shorten some texts in variables.h.
+ PCF8814
The PCF8814 is driven usually in the 3-wire SPI mode. The pin assignment for
the 3-wire SPI (bit-bang only) is:
display config-<MCU>.h default remark
ATmega 328
---------------------------------------------------------------
/RES LCD_RESET PD4
/CS LCD_CS PD5 optional
SCLK LCD_SCLK PD2 SPI clock
SDIN LCD_SDIN PD1 SPI MOSI
If necessary you can rotate the output via the y-flip setting and pulling
the PCF8814's MX pin (x-flip) down or up.
+ SH1106 (partly untested)
The SH1106 is driven by 3-wire SPI, 4-wire SPI or I2C. 3-wire SPI requires
bit-bang mode and SPI_9 to be enabled. The pin assignment for 4-wire SPI is:
display config-<MCU>.h default remark
ATmega 328
---------------------------------------------------------------
/RES LCD_RESET PD4 optional
/CS LCD_CS PD5 optional
A0 LCD_A0 PD3
SCL (D0) LCD_SCL PD2 SPI clock
SI (D1) LCD_SI PD1 SPI MOSI
For 3-wire SPI (bit-bang only):
/RES LCD_RESET PD4 optional
/CS LCD_CS PD5 optional
A0 Gnd
SCL (D0) LCD_SCL PD2 SPI clock
SI (D1) LCD_SI PD1 SPI MOSI
And for I2C:
/RES LCD_RESET PD4 optional
/CS Gnd
SCL (D0) I2C_SCL PD1
SDA (D1) I2C_SDA PD0
SA0 (A0) Gnd (0x3c) / 3.3V (0x3d)
Using the x/y flip settings you can change the output orientation if
neccessary. Many SH1106 based display modules need the x offset set to 2.
In case the pixel lines are all mixed up you can try to enable the sequential
COM pin layout (LCD_COM_SEQ).
+ SSD1306
The SSD1306 is driven by 3-wire SPI, 4-wire SPI or I2C. 3-wire SPI requires
bit-bang mode and SPI_9 to be enabled. The pin assignment for 4-wire SPI is:
display config-<MCU>.h default remark
ATmega 328
---------------------------------------------------------------
/RES LCD_RESET PD4 optional
/CS LCD_CS PD5 optional
DC LCD_DC PD3
SCLK (D0) LCD_SCLK PD2 SPI clock
SDIN (D1) LCD_SDIN PD1 SPI MOSI
For 3-wire SPI (bit-bang only):
/RES LCD_RESET PD4 optional
/CS LCD_CS PD5 optional
SCLK (D0) LCD_SCLK PD2 SPI clock
SDIN (D1) LCD_SDIN PD1 SPI MOSI
And for I2C:
/RES LCD_RESET PD4 optional
SCL (D0) I2C_SCL PD1
SDA (D1&2) I2C_SDA PD0
SA0 (D/C) Gnd (0x3c) / 3.3V (0x3d)
Using the x/y flip settings you can change the output orientation if
neccessary. In case the pixel lines are all mixed up you can try to enable
the sequential COM pin layout (LCD_COM_SEQ) and/or the reversed COM mapping (
LCD_COM_REMAP).
+ ST7036 (untested)
The ST7036 is driven by a 4-bit parallel interface or 4-wire SPI. The pin
assignment for the 4 bit parallel interface is:
display config-<MCU>.h default remark
ATmega 328
---------------------------------------------------------------
DB4 LCD_DB4 PD0
DB5 LCD_DB5 PD1
DB6 LCD_DB6 PD2
DB7 LCD_DB7 PD3
RS LCD_RS PD4
R/W Gnd optional LCD_RW
E LCD_EN PD5
XRESET Vcc optional LCD_RESET
And for 4-wire SPI:
XRESET LCD_RESET PD4 optional
CSB LCD_CS PD5 optional
RS LCD_RS PD3
SCL (DB6) LCD_SCL PD2 SPI clock
SI (DB7) LCD_SI PD1 SPI MOSI
The ST7036i speaks I2C but isn't supported (yet). A special feature of the
ST7036 is a dedicated pin to enable an extended instruction set (pin EXT) which
is enabled usually. In case it's disabled the settings LCD_EXTENDED_CMD and
LCD_CONTRAST need to be commented out.
+ ST7565R
The ST7565R is driven by 4-line SPI. The pin assignment is:
display config-<MCU>.h default remark
ATmega 328
---------------------------------------------------------------
/RES LCD_RESET PD0 optional
/CS1 LCD_CS PD5 optional
A0 LCD_A0 PD1
SCL (DB6) LCD_SCL PD2 SPI clock
SI (DB7) LCD_SI PD3 SPI MOSI
You might need to play with the x/y flip and x-offset settings to get
the correct orientation for your display. The almost compatible NT7538
requires a long reset pulse (LCD_LONG_RESET).
+ ST7735
The ST7735 is driven by 4-wire SPI. The pin assignment is:
display config-<MCU>.h default remark
ATmega 328
---------------------------------------------------------------
/RESX LCD_RES PD4 optional
/CSX LCD_CS PD5 optional
D/CX LCD_DC PD3
SCL LCD_SCL PD2 SPI clock
SDA LCD_SDA PD1 SPI MOSI
You might need to play with the x/y flip settings to get the correct
orientation for your display. With LCD_LATE_ON enabled the tester starts
with a cleared display causing a slight delay at power-on. Otherwise you'll
see some random pixels for a moment.
Meanwhile a semi-compatible LCD module appeared which won't run with the
standard driver. The solution is to use a modified driver (LCD_SEMI_ST7735
instead of LCD_ST7735) with the same settings. Note that the semi-compatible
LCD module doesn't support high SPI clock rates.
+ ST7920
The ST7920 can be driven in 4 bit parallel bus mode or SPI. The pin assignment
for the 4 bit parallel interface is:
display config-<MCU>.h default remark
ATmega 328
---------------------------------------------------------------
/XRESET LCD_RESET Vcc optional
E LCD_EN PD5
RS LCD_RS PD4
RW LCD_RW Gnd optional
D4 LCD_DB4 PD0
D5 LCD_DB5 PD1
D6 LCD_DB6 PD2
D7 LCD_DB7 PD3
And for SPI:
/XRESET LCD_RESET PD4 optional
CS (RS) LCD_CS PD5 optional
SCLK (E) LCD_SCLK PD2 SPI clock
SID (RW) LCD_SID PD1 SPI MOSI
Because of the ST7920's poor design only fonts with a width of 8 pixels can be
used. To cope with the horizontal 16 bit addressing grid I had to add a screen
buffer for characters.
+ STE2007/HX1230
The STE2007 is driven in the 3-wire SPI mode usually. The pin assignment for
the 3-wire SPI (bit-bang only) is:
display config-<MCU>.h default remark
ATmega 328
---------------------------------------------------------------
/RES LCD_RESET PD4 optional
/CS LCD_CS PD5 optional
SCLK LCD_SCLK PD2 SPI clock
SDIN LCD_SDIN PD1 SPI MOSI
If necessary you can rotate the output via the x/y flip settings.
+ VT100 Terminal
The VT100 driver replaces a LCD display and outputs everything to a VT100 serial
terminal. The configuration section for VT100 includes already the activation of
the TTL serial interface. Be aware that the VT100 driver will disable other
options related to the serial interface which might interfere with the output.
* Test push button and other input options
The tester's primary control is the test key, but additional input options
are supported also for a more convenient operation, while some functions
require those.
+ Test Key
The test key starts the tester and also controls the user interface. For that
purpose the tester differentiates between a short and a long key press (0.3s).
The short key press is typically used to proceed with something or to select
a menu item. The long key press performs a context specific action.
If the tester expects you to press a key it will tell you that by displaying
a cursor at bottom right of the LCD. A steady cursor signals that more
information will be displayed and a blinking cursor informs you that the tester
will resume the probing loop. The cursor is supressed for menus and some tools,
because it's obvious that a key press is neccessary.
Optionally you can enable key hints if your tester has additional keys and a
display with a sufficient number of text lines (see UI_KEY_HINTS in config.h).
A hint about the key usage is displayed instead of the cursor, if available.
At the moment there's only one such hint for the probing (Menu/Test).
+ Rotary Encoder (hardware option)
With a rotary encoder you'll get some extra functionality with the user
interface, but that's context specific. The additional functionality is
described in the sections below, if applicable. Some functions make use of
the encoder's turning velocity to allow larger changes or steps of values.
The algorithm for reading the encoder considers the number of Gray code
pulses per step or detent (ENCODER_PULSES). Most rotary encoders have 2 or 4
Gray code pulses per detent. Also the number of steps or detents per complete
360 degrees turn is taken into account (ENCODER_STEPS). You can use that
value to finetune the detection of the turning velocity to optimize the
feedback. A higher value slows the velocity down, while a lower value speeds
it up. In case the encoder's turning direction is reversed, simply swap the
MCU pin definitions for A and B in config_<MCU>.h.
The detection of the turning velocity measures the time for two steps. So you
need to turn the encoder at least by two steps for a mid-range velocity. For