Reading TCNT value

It should work on a MEGA. Did you have an LED connected to PB5 (Arduino Pin 11)? If you want to use the MEGA's built-in LED on Arduino Pin 13 you have to use pin PB7.

1. Bravo! Now, It works. PB7 of MEGA is indeed mapped to Arduino DPin-13 (Fig-1).


2. I desired to get steps so that I could observe when the file is to be saved as .cpp file and the "file will show up as a tab in the IDE".

What I usually do is:

  1. File->New (to create a new minimal sketch)
  2. Edit->Select All
  3. Edit->Cut (to empty the sketch)
  4. File->Save As... (to give the sketch a name)
  5. Select "New Tab" from the tab bar menu.
  6. Give the new tab a name ending in ".cpp" (or ".c")
  7. Do C++ (or C) programming in the new tab.

I can't find "New Tab" and "tab bar menu" in my IDE 1.8.13.

You have never used the button at the right end of the tab bar that pops down the tab bar menu?!?

Are you talking about PC? My PC has no such button marked as "tab bar". There is normal "Tab" button.

Look at the IDE window. Just above your sketch is a bar where tabs are shown. That is the 'tab bar'. Near the right end of that bar is a little square with a triangle in it. That is a menu button. Click on that menu button to pop down the tab menu. In the tab menu you will find an entry for "New Tab" (or whatever that translated to i your selected language). Select that menu entry to create a new tab and give it a file name.

Finally, I have made it. The first training I took in 1979 "on hand" in UK and learnt "something". This time in 2021, I took the 2nd training "on line" and also leant "something".

Sometimes a Trainer is fired by the Station Manager; because, the Trainer did not work hard enough to train the Trainees on which the Company had already spent so much money.

Thank you, GolamMostafa - For the detailed explanation.. It is very informative.

Thanks, Mr. JohnWasser,
I hope this will be quite useful to me before I go on to learn coding in AVRstudio.
I hope this provides me with a helpful rehearsal/ learning ground for me to get a firm grip on coding in AVRstudio.

AVR Studion 4 is an Assembly Language Platform. Are you sure that this assember supports ATmega328P MCU?

Atmel Studio 7.0 supports both assembly , arduino, and C.

I wish to learn coding in AVRstudio_7

Is it "AVR Studio 7" or "AVR Studio 4" or "Atmel Studio 7.0"? I have no idea about "AVR Stuio 7"; I have working experience with other two applications.

It’s now “Microchip Studio 7”

1 Like

More could be found here.

Oh Yeah !
I just observed it.