Hello
Again I experience a problem with my sw and help would be very much appreciated (for additional information also see
https://www.avrfreaks.net/forum/...
and the problem stated there was solved thanks to the great help of MrKendo and Brian Fairchild).
The sw is always compiled using Arduino IDE 1.8.10
HW-Configuration:
- ATMega168pa F_CPU = 16MHz
- 3 LEDs, connected to PD5, PD6, PD7
- 1 XBEE module for USART communication
- 1 TWI-PortExpander MCP23017 connected to GLCD 128x64
- USART (internal) set to 57600 Baud-Rate (U2X = 1) if F_CPU > 15Mhz
- USART (internal) set to 115200 Baud-Rate (U2X = 0) if F_CP =< 15MHz
- USART (external) 115200 Baud-Rate (always)
- TWI: F_CPU > 15Mhz TWI_FREQ = 400000 else TWI_FREQ = 100000
- Compiled software is flashed using ISP
Library "I2C_graphical_LCD_display" see: http://www.gammon.com.au/forum/?...
Function:
- The 3 leds will be "on" for 1 second (one after the other) - see "TIMER2_OVF_vect"
- The USART will send every 70 ms 20 bytes
- The GLCD will display some messages - see "init_prg" and "cont_prg"
Software switches:
#define AVRStud 0 "1" use only "int main()" for compiler
#define Ard_IDE 1 "1" use "void setup()" and "void loop()" for compiler
#define GLCD 1 "1" => use the GLCD lib - indicate on GLCD
=> right now the programme doesn't work as intended when compiled with AVRStud = 1 and GLCD = 1 ==> LED PD5 - PD6 are lit "on" and "off" once (which is correct) and then LED PD7 also is lit "on", stays lit "on" and there's no indication on the GLCD, no USART working. The programme remains frozen - only led PD7 is constantly "on", the programme is not reset via the watchdog which is configured in "init_prg".
=> when compiled with Ard_IDE = 1 and GLCD = 1 then the programme works as intended. The LEDS PD5 - PD7 toggle with 1 second delay time (=> TIMER2!!!!), the USART gets updated every 70ms and the GLCD shows the defined text.
=> when compiled with AVRStud = 1 and GLCD = 0 (=> no library-functions of "I2C_graphical_LCD_display" used) then the programme works as intended. The LEDS PD5 - PD7 toggle with 1 second delay time (=> TIMER2!!!!), the USART gets updated every 70ms and the GLCD remains "dark".
So I guess it's the "I2C_graphical_LCD_display" library which causes the programme to freeze when compiled with "AVRStud" style set.
But for the life of me I do not how to solve that issue and help would be very much appreciated.
Thanks in advance
Hero_123