Problems with Library "I2C_graphical_LCD_display"

Go To Last Post
28 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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
    
    

Attachment(s): 

This topic has a solution.
Last Edited: Fri. Feb 14, 2020 - 10:54 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
    #define AVRStud 0         "1" use only "int main()" for compiler
    #define Ard_IDE 1         "1" use "void setup()" and "void loop()" for compiler

why are there two of these? Surely it's either/or ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hero_123 wrote:
I do not how to solve that issue

Connect the debugger and see where it's freezing.

 

If you don't have a debugger - what's the point in using Atmel Studio at all ?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Let me see if I understand your setup, post a picture please, you have a "bare" M168 your programming via ISP so not using the Arduino bootloader?

How have you setup the fuses for the M168?   The Arduino environment does some h/w setup for the timers and expects the fuses to be set a specific way.

My guess is you have the clock/8 fuse set and the timings are all off as a result.

Do you have an external xtal or resonator on your M168?

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
why are there two of these? Surely it's either/or ?

You'd have thought so.

 

But the code does check them independently

 

frown

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hero_123 wrote:
   #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

 

The syntax is wrong here:  should be something like this?

#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

Your comments may be messing with your settings

After looking at the source code provided above, this does not apply!  Sorry for the noise.

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"

 

Last Edited: Tue. Feb 11, 2020 - 05:28 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That's just the post misrepresenting the code.

 

The actual code has:

#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 */

so should be OK for that ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It seems a very complicated way to run a GLCD.   The Gammon site says that it uses a MCP23017 as an I2C backpack on a KS0108 Display.

 

Yes,  I am sure that it can work.   But it involves a lot of wiring and will be relatively slow.

You can buy a ST7920 display which is the same size and shape as most KS0108 display module.

 

The ST7920 uses 3 GPIO pins for its SPI interface.   Even if you bit-bash on non-SPI pins it will have a better performance.   And be supported by several libraries.

 

I suspect that the MCP23017 approach is only supported by Mr Gammon.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello awneil, hello ki0bk, hello clawson, hello david.prentice

 

Thank you all for your answers.

 

First of all - if I created some confusion with my (really long) explanatory text - I'm sorry for that, but I thought that would help to better understand the issues I have. The important thing is the attached "Klaus_03.c" file. 

 

I trust that my "#defines" are clear when reading that "Klaus_03.c" file, and also why I use these #defines.

 

@ awneil: when I compile that "Klaus_03.c" file I ALWAYS use the Arduino IDE 1.8.10, because the  Library "I2C_graphical_LCD_display" is written for the Arduino environment. And no I do not have a debugger (couldn't use it anyway when compiling with the Arduinbo IDE, could I)

 

I use these "#defines" to compile that file either in a "AVRStudio" style or in the "Arduino IDE" style.

 

@ ki0bk: it's a ATMega168pa, 16Mhz, no Arduino clone; I compile the sw within the Arduino IDE, get a *.hex file (without bootloader & without fuse settings), flash that *.hex file onto my ATMega168pa with an ISP programmer. I created an ISP interface to the chip using the correct ISP - pins (MISO, MOSI, Reset, SCK, GND & 5V PS) and that interface is surely correct. The fuses are set as follows: EXT 0xF9, HIGH 0xDD, LOW 0xFF, LOCK 0xFF.

 

@ david.prentice: well it does work correct when I compile my sw "Arduino IDE" style (means with "void setup()" and "void loop()") and yes, it takes a while to fill a rectancle, no doubt about that. And as the Gammon site says using a MCP23S17 (SPI PortExpander) will make it a wee bit faster. Now the point is - I have never heard of that ST7920till you mentioned it (lack of search may be), but right now I have to deal with my configuartion and that includes the MCP23017 and the above mentioned Library "I2C_graphical_LCD_display".

 

So to make my intentions clear again when using those #defines  - within the Arduino IDE I compile my file "Klaus_03.c" either:

- Arduino IDE style with #define Ard_IDE = 1, #define AVRStud = 0 ==> the sw then uses the "void setup()" routine and the "void loop()" routine 

- AVRStudio style with #define Ard_IDE = 0, #define AVRStud = 1 ===> the sw the uses "int main()" routine only and not "void setup()" and not "void loop()"

 

And I experience the problems mentioned in my first post (freezing when compiling AVRStudio style when using that library

 

Hero_123

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I often build and run "problem AS7.0 projects" on real hardware.    However,  I do not have MCP2317.   I do have regular KS0108 (or ST7920)

 

You should be able to build Arduino / AS7.0 quite easily.

The Arduino init() sets up Timers, PWM, ADC, ...   Just ensure that you fully configure any peripheral SFR registers yourself.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hero_123 wrote:
I trust that my "#defines" are clear when reading that "Klaus_03.c" file, and also why I use these #defines.

It's not at all clear why you use them!

 

I use these "#defines" to compile that file either in a "AVRStudio" style or in the "Arduino IDE" style.

What is the point of that?

 

Hero_123 wrote:
AVRStudio style with #define Ard_IDE = 0, #define AVRStud = 1 ===> the sw the uses "int main()" routine only and not "void setup()" and not "void loop()"

But why would you want to do that?

 

Have you proved that this actually works in a basic setup - without the added complications of the graphics library?

 

How do you know that the graphics library doesn't rely upon stuff that is done "behind the scenes" in the Arduino style?

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Wed. Feb 12, 2020 - 08:35 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello david.prentice, hello awneil

 

Thank you for your replies.

 

@david.prentice (see #10): Yes I checked that Arduino init() (which is hidden in wire.h due to whatever reason) but to no avail - I didn't get a hint /clue what to do to get my sw working when compiled "ARStud" style (with "int main()". Sad though.

 

@awneil (see #11)  3 reasons why I want to do that:

- 1.)  to get my routines working which I wrote using AVRStudio 4 (I've always used AVRStudio 4.18) - for example that TIMER2 was working when compiled  in "AVRStud" -style but not when compiled in "Ard_IDE" style (because in Arduino style there's that init() file which mucks around with timers etc.

- 2.) just to get experience

- 3.) to see if it's possible.

 

And yes - my code works flawless (both "ARVStud" style using "int main()" OR "Ard_IDE" style using "void setup()" and "void loop()") when the graphics functions aren't used - I have proved that, of course. The TIMER2 and the USART work as intended.

And no - when I started working with that graphics lib I didn't know wether that graphics library does rely on stuff "behind the scenes" in Arduino style and well, now I do know.

 

I guess it's best to get in touch with the originator of that lib and ask him how to solve my issues...

 

Hero_123

Last Edited: Wed. Feb 12, 2020 - 10:56 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hero_123 wrote:
I have proved that, of course.

There is no "of course" about it - you need to give the full picture in your post.

 

 

I guess it's best to get in touch with the originator of that lib and ask him how to solve my issues...

Indeed.

 

Or just get on with debugging it yourself ...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello awneil

 

Thank you for your reply.

 

First of all - no harm meant 

 

awneil wrote:

Or just get on with debugging it yourself ...

Yeah, would do that if

 

- I had a debugger (and yes, I know you've already asked what's the point in using AVRStudio without having a debugger)

- I knew how to use a debugger within the Arduino IDE (I do not compile "Klaus_03.c" with the AVRStudio 4.18)

 

regards

 

Hero_123

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

While a debugger is a great tool, you can still do debugging without one!

 

Using printfs & LEDs is a good start; oscilloscope & logic analyser help ...

 

The most important debug tool is the one between your ears!

 

There was a load of tips in this thread:  https://www.avrfreaks.net/forum/how-do-i-check-life-signs-scope-atmega2560-standalone

 

How To Debug: https://www.avrfreaks.net/commen...

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello awneil

 

Thank you for the links.

 

I modified my programme to the absolute minimum (no USART, no TIMER2) but again to no avail.

 

And I agree - the most important debugging tool is the one between my ears, however I hit the middle stump.

So I posted my problem at https://forum.arduino.cc/index.p.... Perhaps there the originator of the library has a hint.

 

regards

 

Hero_123

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hero_123 wrote:
I modified my programme to the absolute minimum (no USART, no TIMER2) but again to no avail.

So you have a basic problem - nothing to do with the library per se.

 

You need to do some basic study into how to properly use the Arduino IDE to do "bare metal" programming - ie, without all the Arduino framework, setup(), loop(), etc.

 

eg, https://forum.arduino.cc/index.p...

 

Although I still can't see why you'd want to do that: the whole point of Arduino is precisely to save you from doing that!

 

Rather that fight the tools, I always feel it's better to use the tool in the way it was designed & intended. If  that doesn't fit what you want to do, then use a different tool!

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I still don't understand this Arduino/AS7 thing anyway? Why do you want the software to be buildable in both environments? Surely the ONLY advantage AS7 has over Arduino is the ability to do debugging? If that is so then if its the AS7 built version that won't work as expected then why can't the debugger (the reason you moved to AS7 in the first place) tell you what the problem is?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If I had the hardware,   I would probably help you debug (in either Arduino IDE or AS7.0)

 

No one is going to replicate your "unusual" hardware.

 

If it was just a question of driving a regular 128x64 display,   many people could use real hardware e.g. 128x64 OLED

Get everything to build nicely on AS7.0 and then replace the 128x64 with your "unusual backpack"

 

Another incidentally:  you could just use a MEGA2560 with plenty of GPIO pins.   It will be smaller and neater than the two-chip mega168 + mcp23017

The software is simpler and FASTER.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello awneil, hello clawson, hello david.prentice

 

I want to thank you all for your replies.

 

I see, I better explain the idea/need behind that obviously strange idea of compiling my software in that special way.

 

The answer is simple - I got hold of an GLCD128x64 and I found the above mentioned library by Nick Gammon, which uses a MCP23017 portexpander and is written for Arduino. So I wired that display accordingly and as I use an ATMega168pa with only a certain amount of ports available I have to use that portexpander to be able to use the display.

 

Then I realized that I can't use my normally used AVRStudio4.18 as the library was written for Arduino.

 

No problem I thought, try to get the sw (with that library) to work when using that Arduino IDE and then just port it to the AVRStudio4.18. Now here the sh** hit the fan - I realized that I could make my sw work when compiling it with the Arduino IDE in Arduino style - means using "void setup()" and "void loop()" (all is working as expected), but making it work with "int main()" using the Arduino IDE and that library - well, you all know the disappointing results.

 

I do not favour that Arduino stuff, I like to use the AVRStudio4.18 as I then have a much better access to the ports, TIMERS, USART etc - all my sw is written in C using that AVRStudio4.18. And I have my own libs created for the USART, I2C, TIMERs, ADC etc.

 

Now of course you may say "well, just rewrite the lib then" - and again here I hit the the middle stump - to be able to rewrite that lib I'd be familiar with c++ - which I'm not. And there's much more than just that lib ....

Now of course you may say "well, then take a look at the data sheets of the display, and at the I2C data sheet by NXT and write that stuff in C" - yes, you're right - I'll have to do that in the end - if there's no other solution.

 

And well - I do not consider my hardware "unusual" - it's a "bare metal" ATMega168pa, a MCP23017 portexpander and a GLCD 128x64 if I might say that.

 

I've narrowed my problem down to that lib, because the other stuff (TIMER2 and USART) work correct, when compiled in the Arduino IDE with "int main()" set and that lib NOT included.

 

regards

 

Hero_123

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hero_123 wrote:
means using "void setup()" and "void loop()" (all is working as expected), but making it work with "int main()" u
In this sense the ONLY different between "plain C++" and "Arduino" is that the latter happens to have a main() that looks like:

int main(void) {
    setup();
    while(1) {
        loop();
    }
}

So if you add that to your "plain C++" version it should be identical. 

 

However there are two further subtle differences: In a "plain" environment even before main() there's a very simple:

void reset() { // at reset vector
    crt();
}

void crt() {
    some_very_simple_setup();
    main();
}

but in the Arduino environment (when it's being used as a true Arduino) there is:

void reset() { // at BOOT reset vector
    crt_boot();
}

void crt_boot() {
    some_very_simple_setup();
    bootloader_main(); 
}

void bootloader_main() {
    possibly_mess_with_some_bits_of_hardware();
    do_the_entire_bootloading_thing();
    run_the_app();
}

void run_the_app() {
    crt_app()
}

void crt_app() {
    some_very_simple_setup();
    app_main(); 
}

void app_main() {
    setup();
    while(1) {
        loop();
    }
}

Also the main() isn't really just called to setup() and loop() it is really:

int main(void) {
    arduino_internal_init()
    setup();
    while(1) {
        loop();
    }
}

During that arduino_internal_init() it does all kinds of things like starting timers and configuring serial devices and stuff like that.

 

So you have to be aware of the initialisation stuff that has also occurred all the way up to the point you get control at setup().

 

If the code works in that environment but not in the plain main() case then there's something from all the Arduino "housekeeping" it is clearly relying on.

 

Oh and as this is all C++ code there's another thing to consider and that is c'tors (constructors). Classes in C don't necessaily just have a directly callable init()/setup() or whatever but there can be "hidden" code that runs even before you get a chance to call such things that occurs as a result of the very fact that the class is created. If that is not happening the same for the hardware drivers in "plain" as it does in the Arduino world that is another difference you might need to take care of.

 

Say, for example, that in the c'tor for the mcp23017 support class it's actually using "millis()" to time some configuration (just as an example) then in the "plain" environment that timing may not be happening as you expect.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hero_123 wrote:
I can't use my normally used AVRStudio4.18 as the library was written for Arduino.

You do realise that Atmel Studio 7 can import an Arduino Sketch - thus turning it into a "normal" AS7 project?

 

 I like to use the AVRStudio4.18

Maybe it's time to join the 3rd decade of the 21st Century ... ?

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
Why do you want the software to be buildable in both environments?

He doesn't!

 

He wants to do it all in the Arduino IDE, but wants to use that as if it were a "bare metal" environment

 

Makes no sense to me, though.

 

frown

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello clawson, hello awneil

 

Thank you for your answers!

 

@clawson: your explanation (# 21) great, though I didn't grasp verything (yet!). Will work on that.

 

@awneil: 

You do realise that Atmel Studio 7 can import an Arduino Sketch - thus turning it into a "normal" AS7 project?

well, I didn' know that

 

  Maybe it's time to join the 3rd decade of the 21st Century ... ?

yeah, but you know - I'm an engineer and one thing I've learned all my life is "never touch a running system" wink 

 

Well anyway thanks a lot for all your help (very much appreciated indeed!!!).

 

I finally got the solution (thanks to https://forum.arduino.cc/index.p... and now I can continue (making silly errors and asking stupid questions wink))

And Nick Gammon's I2C_LCD library works, too. 

 

regards

 

Hero_123

Last Edited: Fri. Feb 14, 2020 - 10:58 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hero_123 wrote:
well, I didn' know that

you do now!

 

smiley

 

"never touch a running system" wink 

But your system is not running - it is not doing what you want it to.

 

That most certainly is the time to start looking at whether an update could help you!

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello awneil

 

But your system is not running - it is not doing what you want it to.

Yeah, well, fortunately right now my system is running however I for sure will experience more issues further down the road when implementing more "features" wink and then I might have to update (at the latest).

 

Well, anyway I'll get the latest version of the AVR Studio (just in case...)

 

By the way - can I have both versions of that AVRStudio on the same drive installed - I mean AVRStudio4.18 (my preference) and the latest version?

 

regards

 

Hero_123

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hero_123 wrote:
latest version of the AVR Studio

It hasn't been called "AVR Studio" for a very long time - it's Atmel Studio now!

 

can I have both versions of that AVRStudio on the same drive installed

I don't know, but I'd guess so - as Atmel Studio, AFAIK, is completely different from AVRStudio 4

 

 

At this point, I guess the real question is whether you'd be better off with MPLab X ... ?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

The thing that AS7 is more likely to "bump into" is if you already have some version of Visual Studio (specifically VS2015). There's nothing shared between AS4 and AS7 so they should not upset each other and should happily co-exist.