@anajonesr Yeah it's really simple. Although I'm using it to fade an LED, and I'm using an ADC conversion to adjust the time the pulse is OFF. The problem I'm having is as I turn a pot to adjust the ADC input, the output on the non-PWN pin is really choppy. I turn real slow, and it dims like it should, but there are points where it just completely turns off. Any thoughts?
I would like to thank you for your continued thoughtful presentation of beneficial education material. You have greatly reduced the time the rest of us will need to get up and running on our own project. Thank you for your leg work.
@bagatelox I don't think that would be a problem. I will add that to the list.
Regarding the Arduino. I find it amusing that a conversion is desired as the main MCU for Arduino is the AVR. I like the idea, as it would bring the Arduino lovers back to basics.
Will do exactly the same BUT it wont, as the first example, run and check the second statement, if the first one is true. This way you save the microcontroller a lot of cycles.
Sorry for the < and > but im not able to write the signs (less than and greater than) on youtube, so i tried to use the html characters for it, but this didn't work as well :/
@TheDragothica Yes, that is a very good method to exclude the second condition, and it will work if the state machine will only have two conditions. I'm still investigating even more efficient code for code that requires multiple divisions of activity, and with responses like yours, I'm sure we will get there quicker. Thanks for the comment.
@amtpdb1 Also, most of the AVR MCUs are very similar, so the changes from one to the other may just be in pin locations on the chip. The program will only change in a minor way, if at all.
Will any of the atmega32 chips work with all the programs you have written so far or is there one in particular that is to be used? I ask this as for some reason I thought you were using a atmega32-16pu in the beginning and it looks like you are using a 324p now. Will either one work?
wait nevermind you said it in the beginning. you're a genius.
Azlateen 3 weeks ago
@Azlateen Not a problem.
anajonesr 3 weeks ago
correct me if i'm wrong, but is this basically PWM on any non-PWM pin??
Azlateen 3 weeks ago
@Azlateen Yes. And you caught on to the simplicity. Engineers make PWM sound so complicated, but it's just a "regular" on and off signal. Enjoy.
anajonesr 3 weeks ago
@anajonesr Yeah it's really simple. Although I'm using it to fade an LED, and I'm using an ADC conversion to adjust the time the pulse is OFF. The problem I'm having is as I turn a pot to adjust the ADC input, the output on the non-PWN pin is really choppy. I turn real slow, and it dims like it should, but there are points where it just completely turns off. Any thoughts?
Azlateen 3 weeks ago
@Azlateen If it is not a bad connection, there is something in the program that you are overlooking
anajonesr 3 weeks ago
I would like to thank you for your continued thoughtful presentation of beneficial education material. You have greatly reduced the time the rest of us will need to get up and running on our own project. Thank you for your leg work.
paulfsherwood 1 month ago in playlist Microcontroller Tutorial - A Beginners Guide
bagatelox 1 month ago
@bagatelox Thanks.
anajonesr 1 month ago
robotypic blogspot com
Good experiments to study, with proteus. Can you 'translate' that to AVR?
Another cool thing would be to take examples of application with arduino and implement with Mega32.
bagatelox 1 month ago
@bagatelox I don't think that would be a problem. I will add that to the list.
Regarding the Arduino. I find it amusing that a conversion is desired as the main MCU for Arduino is the AVR. I like the idea, as it would bring the Arduino lovers back to basics.
anajonesr 1 month ago
You could teach how to control many seven segment display using the 74HC595 instead of using multiplexing.
bagatelox 1 month ago in playlist Microcontroller Tutorial - A Beginners Guide
@bagatelox I'm getting to that. I have that as a planned tutorial on the home page of newbiehack. Thanks.
anajonesr 1 month ago
@13:23 about being efficient with the microcontroller:
if (TCNT1 >= 800 && TCNT1 <= 2400) { //perform code1 }
if (TCNT1 < 800 || TCNT1 > 2400) { //perform code2 }
I believe (and please correct me if i'm wrong) that:
if (TCNT1 >= 800 && TCNT1 <= 2400) { //perform code1 } else { //perform code2 }
Will do exactly the same BUT it wont, as the first example, run and check the second statement, if the first one is true. This way you save the microcontroller a lot of cycles.
TheDragothica 1 month ago
Sorry for the < and > but im not able to write the signs (less than and greater than) on youtube, so i tried to use the html characters for it, but this didn't work as well :/
TheDragothica 1 month ago
@TheDragothica Yes, that is a very good method to exclude the second condition, and it will work if the state machine will only have two conditions. I'm still investigating even more efficient code for code that requires multiple divisions of activity, and with responses like yours, I'm sure we will get there quicker. Thanks for the comment.
anajonesr 1 month ago
Thanks for clearing this up for me.
amtpdb1 1 month ago
@amtpdb1 Also, most of the AVR MCUs are very similar, so the changes from one to the other may just be in pin locations on the chip. The program will only change in a minor way, if at all.
anajonesr 1 month ago
Will any of the atmega32 chips work with all the programs you have written so far or is there one in particular that is to be used? I ask this as for some reason I thought you were using a atmega32-16pu in the beginning and it looks like you are using a 324p now. Will either one work?
Thanks
amtpdb1 1 month ago
@amtpdb1 Yes, either one will work and I in the video, I note if there is a change, like the TIMSK register in this video.
anajonesr 1 month ago
1st?
Bojanpzs1 1 month ago