I own an "AY-AT" ATmega328 with ST7735 color LCD module.
Recently I tried to compile the 1.34M firmware, either using WinAVR, avr-gcc-8.2.0 and Atmel Studio 7.
I get a warning, is it normal ?:
tools.c: In function 'Cap_Leakage':
tools.c:3302:9: warning: 'U1' may be used uninitialized in this function [-Wmaybe-uninitialized]
Display_Value(U1, -3, 'V'); /* display voltage */
^~~~~~~~~~~~~~~~~~~~~~~~~~
Another problem is that I can not make everything I want in the chip .... maybe I ask too much from this small tool.
Basically I would need to be able to test the goodness of the components but I do not need to measure resistance, impedance,
capacity, read or generate frequencies, because I own other equipment.
But I wish I could test loss and ESR, IR detector and IR transmitter, Zener.
Below is my config.h, what could I remove to make us stay SW_IR_TRANSMITTER?
/* config.h */
/* source management */
#define CONFIG_H
/* rotary encoder for user interface */
#define HW_ENCODER
#define ENCODER_PULSES 4
#define ENCODER_STEPS 20
/* Typical voltage of 2.5V voltage reference (in mV) */
#define UREF_25 2495
#define HW_ZENER
#define HW_FREQ_COUNTER_BASIC // <<<
#define FREQ_COUNTER_PRESCALER 16 /* 16:1 */
#define SW_PWM_SIMPLE
#define SW_INDUCTOR
#define SW_ESR
#define SW_ENCODER
//#define SW_SQUAREWAVE // <<<
#define SW_IR_RECEIVER
//#define SW_IR_TRANSMITTER // <<<
#define SW_IR_EXTRA // <<<
#define SW_OPTO_COUPLER // <<<
#define SW_UJT
#define SW_PROBE_COLORS
//#define SW_SERVO
#define SW_DS18B20 // <<<
#define SW_CAP_LEAKAGE
/* ************************************************************************
* Makefile workaround for some IDEs
* ************************************************************************ */
#ifndef OSC_STARTUP
#define OSC_STARTUP 16384
#endif
#define UI_ENGLISH
#define CYCLE_DELAY 3000
#define CYCLE_MAX 100 // 5
#define BAT_DIVIDER
#define BAT_R1 10000
#define BAT_R2 3300
#define BAT_OFFSET 100 // 290 misurato 7,51 - 7,46
#define BAT_WEAK 7400
#define BAT_LOW 6400
#define SAVE_POWER
#define UREF_VCC 5001
#define UREF_OFFSET 0
#define R_LOW 680
#define R_HIGH 470000
#define RH_OFFSET 350
#define R_ZERO 20
#define CAP_WIRES 2
#define CAP_PROBELEADS 9
#define CAP_DISCHARGED 2
#define CAP_FACTOR_SMALL 0 /* no correction */
#define CAP_FACTOR_MID -40 /* -4.0% */
#define CAP_FACTOR_LARGE -90 /* -9.0% */
#define ADC_SAMPLES 25
#define CPU_FREQ F_CPU
#if defined(__AVR_ATmega328__)
#include "config_328.h"
#elif defined(__AVR_ATmega324P__) || defined(__AVR_ATmega644__) || defined(__AVR_ATmega1284__)
#include "config_644.h"
#else
#error <<< No or wrong MCU type selected! >>>
#endif
/* ADC clock */
#if CPU_FREQ == 20000000
/* 20MHz MCU clock */
#define ADC_FREQ 156250
#else
/* all other MCU clocks */
#define ADC_FREQ 125000
#endif
/* 1MHz/250kHz */
#if CPU_FREQ / ADC_FREQ == 4
#define ADC_CLOCK_DIV (1 << ADPS1)
#endif
/* 1MHz/125kHz 2MHz/250kHz */
#if CPU_FREQ / ADC_FREQ == 8
#define ADC_CLOCK_DIV (1 << ADPS1) | (1 << ADPS0)
#endif
/* 2MHz/125kHz 4MHz/250kHz */
#if CPU_FREQ / ADC_FREQ == 16
#define ADC_CLOCK_DIV (1 << ADPS2)
#endif
/* 4MHz/125kHz 8MHz/250kHz */
#if CPU_FREQ / ADC_FREQ == 32
#define ADC_CLOCK_DIV (1 << ADPS2) | (1 << ADPS0)
#endif
/* 8MHz/125kHz 16MHz/250kHz */
#if CPU_FREQ / ADC_FREQ == 64
#define ADC_CLOCK_DIV (1 << ADPS2) | (1 << ADPS1)
#endif
/* 16MHz/125kHz 20MHz/156.25kHz */
#if CPU_FREQ / ADC_FREQ == 128
#define ADC_CLOCK_DIV (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0)
#endif
#define C_ZERO CAP_PCB + CAP_WIRES + CAP_PROBELEADS
#define MCU_CYCLES_PER_US (CPU_FREQ / 1000000)
#define MCU_CYCLES_PER_ADC (CPU_FREQ / ADC_FREQ)
#define MCU_CYCLE_TIME (10000 / (CPU_FREQ / 1000000))
/* additional keys */
/* rotary encoder, increase/decrease push buttons or touch screen */
#if defined (HW_ENCODER) || defined (HW_INCDEC_KEYS) | defined (HW_TOUCH)
#define HW_KEYS
#endif
/* options which require additional keys */
#ifndef HW_KEYS
/* PWM+ */
#ifdef SW_PWM_PLUS
#undef SW_PWM_PLUS
#define SW_PWM_SIMPLE
#endif
/* squarewave generator */
#ifdef SW_SQUAREWAVE
#undef SW_SQUAREWAVE
#endif
/* Servo Check */
#ifdef SW_SERVO
#undef SW_SERVO
#endif
#endif
/* options which require a MCU clock >= 8MHz */
#if CPU_FREQ < 8000000
/* ESR measurement */
#ifdef SW_ESR
#undef SW_ESR
#endif
/* old ESR measurement */
#ifdef SW_OLD_ESR
#undef SW_OLD_ESR
#endif
#endif
/* SPI */
#if defined (SPI_BITBANG) || defined (SPI_HARDWARE)
#define HW_SPI
#endif
/* I2C */
#if defined (I2C_BITBANG) || defined (I2C_HARDWARE)
#define HW_I2C
#endif
/* TTL serial */
#if defined (SERIAL_BITBANG) || defined (SERIAL_HARDWARE)
#define HW_SERIAL
#endif
/* VT100 display driver disables other options for serial interface */
#ifdef LCD_VT100
#ifdef UI_SERIAL_COPY
#undef UI_SERIAL_COPY
#endif
#ifdef UI_SERIAL_COMMANDS
#undef UI_SERIAL_COMMANDS
#endif
#endif
/* options which require TTL serial */
#ifndef HW_SERIAL
#ifdef LCD_VT100
#undef LCD_VT100
#endif
#ifdef UI_SERIAL_COPY
#undef UI_SERIAL_COPY
#endif
#ifdef UI_SERIAL_COMMANDS
#undef UI_SERIAL_COMMANDS
#endif
#endif
/* options which require TTL serial RW */
#ifndef SERIAL_RW
#ifdef UI_SERIAL_COMMANDS
#undef UI_SERIAL_COMMANDS
#endif
#endif
/* OneWire: probe leads prevail */
#ifdef ONEWIRE_PROBES
#undef ONEWIRE_IO_PIN
#endif
#ifdef ONEWIRE_IO_PIN
#undef ONEWIRE_PROBES
#endif
/* options which require OneWire */
#if ! defined (ONEWIRE_PROBES) && ! defined (ONEWIRE_IO_PIN)
#ifdef SW_DS18B20
#undef SW_DS18B20
#endif
#endif
/* touchscreen */
#ifdef TOUCH_PORT
#define HW_TOUCH
#endif
/* LCD module */
#ifdef LCD_CONTRAST
#define SW_CONTRAST
#else
#define LCD_CONTRAST 0
#endif
/* color coding for probes requires a color graphics display */
#ifdef SW_PROBE_COLORS
#ifndef LCD_COLOR
#undef SW_PROBE_COLORS
#endif
#endif
/* component symbols for fancy pinout */
#if defined (SYMBOLS_24X24_H)
#define SW_SYMBOLS
#endif
#if defined (SYMBOLS_24X24_HF) || defined (SYMBOLS_30X32_HF) || defined (SYMBOLS_32X32_HF)
#define SW_SYMBOLS
#endif
#if defined (SYMBOLS_24X24_VFP)
#define SW_SYMBOLS
#endif
#if defined (SYMBOLS_24X24_VP_F)
#define SW_SYMBOLS
#endif
/* symbols require graphic display */
#ifdef SW_SYMBOLS
#ifndef LCD_GRAPHIC
#undef SW_SYMBOLS
#endif
#endif
/* frequency counter */
#if defined (HW_FREQ_COUNTER_BASIC) || defined (HW_FREQ_COUNTER_EXT)
#define HW_FREQ_COUNTER
#endif
/* IR detector/decoder: probe lead based decoder prevails */
#ifdef SW_IR_RECEIVER
#undef HW_IR_RECEIVER
#endif
#ifdef HW_IR_RECEIVER
#undef SW_IR_RECEIVER
#endif
/* ************************************************************************
* EOF
* ************************************************************************ */
Thank You very much for any answer.