Embedded Systems Course - Lecture 02: Concepts of Microcontrollers, Part 1

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

most interesting topics I ever wanted to study while doing my computer science degree, but couldn't at the time. You made it a reality. thanks.

madpuri
Автор

I made the LED port bit directly equal to the opposite of the button port bit without the use of the if statement, as in -

PortD.DR.bit.B0 = ! (Port4.DR.bit.B0)

Would this work?

rjxxl
Автор

I am confused here actually. Why are you *reading* the Data Register (DR), instead of the PORT register? In the text on page 18/19, in order to read from the switches, you do this:

if (PORT4.PORT.BIT.B0 == 0) // check to see if switch 1 is pressed
PORTD.DR.BIT.B0 = 1; // turn on LED

Yet at the 1:03:00 mark you are reading from DR. That doesn't make sense to me.

Also, that code on page 18/19 is a bit odd and didn't work for me. So I re-wrote it. It's on pastebin at: vHYrvewf

bluehornet
Автор

could you tell me which is better AVR or PIC, please ?

moh.
join shbcf.ru