Go Down

Topic: Ch-6: Interrupt Structure of ATmega328 (Read 11510 times) previous topic - next topic

GolamMostafa

Code: [Select]
Void setup()
{

I don't need to present that to the compiler to know that it will be spat out.
That's why the French people say:

"The Rules are for the Monkeys and not for the Human Beings who constantly apply their instincts and judgments."

GolamMostafa

I don't want you to waste your time and effort, but also I don't want anyone posting authoritative-looking topics that are misleading.

I don't have the time to check all posts on the forum, nor do the other mods, but ones with blatant (to me) mistakes, or topics reported to the moderators will obviously be pointed out.
People are punished for the crimes and not for the mistakes! Crimes are committed intentionally; the mistakes are the parts of human nature!

By correcting mistakes one can reach to a very high level of perfection, but not the culprits!

Coding Badly

By correcting mistakes one can reach to a very high level of perfection, but not the culprits!
Excellent!  I am glad to know that your next action will be correcting your mistakes so you can reach to a very high level of perfection!

A great place to start is that "Void".


AWOL

#18
Aug 15, 2017, 04:14 pm Last Edit: Aug 15, 2017, 04:15 pm by AWOL
That's why the French people say:

"The Rules are for the Monkeys and not for the Human Beings who constantly apply their instincts and judgments."
I've spent a significant amount of my life in many different parts of France, and have many French friends and acquaintances, and I have yet to hear one of them utter that phrase.

I simply apply my reading skills, but then, I'm just a naked ape. The compiler is even dumber.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

GolamMostafa

#19
Aug 15, 2017, 07:24 pm Last Edit: Aug 16, 2017, 07:28 am by GolamMostafa
I've spent a significant amount of my life in many different parts of France, and have many French friends and acquaintances, and I have yet to hear one of them utter that phrase.
Myself, too, have spent a major part (more than 15 years) of my early car rear with second largest Oil Company of the world where I encountered a mixed culture of British, French, American, and others minority including myself. We were working mainly in the oil fields located in desert, off-shore, and on-shore as well. In this multi-cultural working environment, I came to be familiar with two spontaneous foreign expressions : "Fu..... in the  hell" and "Rules for the Monkeys....; the Americans were a bit shy."

The first was fine, which I even enjoyed in 1979 in Rugby, UK; but, the second was really targeted at me by my Station Manager Mr. Patrick Philip , a French man.

It was the time of 1985 in an oil field in the Far East where I had been logging the 3000-ft deep oil-well data  for the last 20+ hours using PDP-11, Magnetic Tape, and a Tektronics Monitor; the client was the Shell Oil Company. As I was nearing the end of the job, I did not give much attention on the real-time quality control of the logging data of the last 100-ft. After finishing the logging job, I was doing some house-keeping works in the doghouse.

In the mean time, my Station Manager arrived as a part of his field visit and played back few selected portions of the logged data before handing over it to the client. Having had a look at the last 100-ft logging data (it was a noisy record due high logging speed; the crews were hungry, sleepy, ...), he shouted at me: Mo.....! "I placed a well trained man like you in front of a Computer to control that the machine, you, and crew together would be recording technically valid data. You left everything to the Computer believing that the machine would be doing good job for you. And then he commented, 'Rules are for the Monkeys and not for the human beings....'. Never mind, this is the way how we learn things!"    

It is about 30 years! Perhaps, I remained the same. My keyboard was typing capital V (in Void) instead of lower-case v, and I was made responsible for it because it was my duty to check what actually had appeared on the monitor before it was released to the pupils (the Forum).

Thanks for giving time to hear my story!

Have a good night!            

GolamMostafa

Excellent!  I am glad to know that your next action will be correcting your mistakes so you can reach to a very high level of perfection!
Mistakes can only be corrected if someone generously points to it! Where shall we get such a generous man? Everybody is perfect here except me! A perfect man always sees everything in a perfect way.  So, there will be none, at least as a part of argument, to notice my mistakes; there will be no chance for me even to become a good man; never mind about perfection!!

cattledog

#21
Aug 15, 2017, 08:07 pm Last Edit: Aug 15, 2017, 08:10 pm by cattledog
Quote
This is Education and Teaching Section. I have to deal with tens of pupils who are individually using Arduino UNO Kits for their course works. The pupils desire that I prepare and post the class lectures in the Education and Teaching Section of the Forum so that they can read it online and down load it.
You are trying to teach beginning Arduino students about external interrupts. I think that re-enabling interrupts within the isr so as to use delay() is not a good approach. I think you would be far better to hammer home the message to keep the isr short and fast and don't call functions which rely on interrupts being enabled.

Why not set a flag and execute the function in loop() with blink without delay. Teaching the use of flag setting in an ISR  is a valuable lesson.

You may believe differently, but when you see all the broken ISR's posted on this forum, and posters asking for help it leads me to be skeptical of your approach.

GolamMostafa

#22
Aug 15, 2017, 08:17 pm Last Edit: Aug 16, 2017, 02:33 pm by GolamMostafa
[...] Why not set a flag and execute the function in loop() with blink without delay. Teaching the use of flag setting in an ISR  is a valuable lesson.

You may believe differently, but when you see all the broken ISR's posted on this forum, and posters asking for help it leads me to be skeptical of your approach.
Thanks for the valuable comment. I have noted it down.

Yes! Blink without delay would be an excellent approach to keep the ISR short.

//----------------------------------------------------------------------------------------------------------
Let me share with the readers my experiences of teaching interrupt (or any other) concepts with the senior level graduate students of Electrical Engineering:

(1)  As a faculty, one has to prepare a working experiment that gives a visible result, and the experiment should be reproduceable. The faculty makes the experiment in accordance with his level of understanding of the subject matter and the practical experience.

(2)  The faculty must prepare the step-by-step procedures of the experiment so that each and every student can reproduce the result just by following the steps.

(3)  The faculty goes into interactive section with the pupils to review the theoretical and the setup aspects of the experiments.

(4)  The pupils are again asked to repeat the experiment and justify the necessity of the steps as have been laid down in the experiment.

(5) The students are now allowed to search in the web or among themselves to look for alternative or better ways of doing the experiment. 

(6  In 3x50 minutes class, the faculty and the students (a few of good quality) have time to play around with the experiment. The advantage is that the students have their own (purchased) Arduino UNO Learning Kits.

(7)  My understanding is: These are Electrical Engineering level students. They don't have wide exposure to programming arena like the CSE students.  Very often, we need to go to assembly level to make them understand what is going on at the register/memory level of the MCU.

//-----------------------------------------------------------------------------------------------------------       

AWOL

And the pupils are happy to correct the code themselves, after downloading it?
Ans:  Ask the pupils.
I don't KNOW any of YOUR students.

Quote
Do you pre-warn them that it won't compile, and then won't work, even when the syntactic errors are fixed?
Ans:  The question should come from the pupils/Evaluation Committee.
No, the question came from me.

Quote
Is this part of the teaching process?
Ans: The question again should come from the Evaluation Committe.
Again, you're not following - the question came from me (also sp. "committee")

Quote
Doesn't your faculty have its own website?
Ans: No need! The faculty and the pupils have paid hundreds of dollars for the Arduino Learning Kits. It is their rights and not the privileges to enjoy all the available resources of the Forum subject to the compliance of the rules of the Forum.
Over years, I've spent many tens of thousands of pounds at Shell and Esso, but they don't allow me to flog my goods at their outlets. Why is that? Aren't  they required to grant me some sort of squatters' rights at their filling stations?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

AWOL

Quote
I wish to expose a visible and simple result in the ISR to demonstrate that the MCU has, in fact, gone to the ISR by suspending the Main Line Program.
You've written an ISR - what more obvious illustration is there that you're in an ISR?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

GolamMostafa

Over years, I've spent many tens of thousands of pounds at Shell and Esso, but they don't allow me to flog my goods at their outlets. Why is that? Aren't  they required to grant me some sort of squatters' rights at their filling stations?
OK! You have given your decision finally!

AWOL

OK! You have given your decision finally!
No, I posted a simplistic parable.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

urmil123

Have you compiled the program? Have you seen any errors?   
Yes I did and it worked. When I was reading for the first time, I didn't see that interrupts() function was used. Silly me. Thanks a lot.
Stalking the closest to the edge
Imposition of depravity
Sanity holding by a thread
Desperation draws them close to me

GolamMostafa

#28
Aug 15, 2017, 08:44 pm Last Edit: Aug 15, 2017, 08:47 pm by GolamMostafa
Today at 06:26 pm to 06:28 pm

2 minutes!

Speed of Light = 1, 86, 000 miles/sec

Speed of human mind!

Limit of elasticity???

urmil123

I don't KNOW any of YOUR students.
I'm one of his students and yes. We find these very helpful.
Stalking the closest to the edge
Imposition of depravity
Sanity holding by a thread
Desperation draws them close to me

Go Up