Raspberry Pi Pico Lecture 3: Timers, timer interrupts, SPI

preview_player
Показать описание
0:00 - Administrivia
1:15 - Review and lecture goals
4:40 - How to use technical documentation
6:50 - What the example does
8:25 - Includes
11:15 - Macros for parameter values, and declaring some variables
15:15 - Associating GPIO’s with internal SPI signals
18:05 - Initializing stdio
19:15 - Initializing and formatting the SPI channel
23:50 - Brief explanation of SPI communication, with DAC as case study
32:50 - Configuring GPIO functions
34:50 - The 64 bit Timer
39:20 - Timer Alarm registers and interrupts
40:50 - Other timing resources on the RP2040
42:30 - Hardware interface library for the timer
44:01 - Higher level pico_time library and repeating timer interrupts
45:10 - Alarm pools
47:30 - Repeating timers
48:05 - Reiterating timer levels of abstraction
49:50 - Creating a repeating timer in code

Fall, 2022 lectures from ECE 4760 (Digital Systems Design Using Microcontroller) at Cornell University.

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

Adam I want to thank you for these videos. Watching them and learning from them makes me feel alive and excited. I do not have an electronic background, I worked in construction most all my life. My first computer I bought in 1990, I took it home opened the box and completely disassembled the hole thing in my living room floor. My wife walked in and said to me, what did you do? I did not receive any answers to my question at all that day because I could not see what was going on inside. I did not know how to get to where I wanted to go. In watching you class teaching, I am learning how to get inside. The tools needed to get to where I wanted to go. How to use the tools through the data sheets and how to use those sheets. It is so exciting I just can not weight to break each video down word by word to not miss anything that you say. My eyes can not see as good as they used to and I try to see what you are pointing to on the screen to the right of the video. I wish I could afford to take one of your classes but I cannot. I have the Pico controllers but is their any documentation the kids in the class are reading from in the class, maybe I could buy that and learn even more. I only hope and yes pray that these kids understand the greatness of what you are teaching them. You are not feeding them you are teaching them how to fish and my friend that will feed them forever. I pray that God will bless you in everything that you do! You are blessing me every time I watch one of your videos, and I thank you for that my friend. I am 59 years old and love electronics. I am disabled now and suffer from dementia, but I keep trying to make my mind work hard because I am afraid of loosing what little I have left. I apologize for my comment being so long and I understand you are buzzy and no reply is needed. Thank you and God Bless!!

mod
Автор

Few notes that might be helpful for somebody trying to follow it at home:
1. add_repeating_timer_us might freeze on -25 on some Pico-like boards. Had to reduce to -50 (20 khz).
2. Using R-2R ladder with 8-bit shift register instead of DAC can work with SPI, but Pico only does MSB order. So need reversing bit order before sending, or connecting to shift register accordingly.

thatskyfox
Автор

14:08 : shouldn't t line 53 read something like
DAC_data = (DAC_config_chan_A | ((sin_table[ phase_accum_main>>24] + 2048 ) & 0x0FFF))
?

stefanhennig
Автор

Bruce's answer at the end was mangled. If the routine doesn't complete in time, does the stack overflow, due to calling the callback again before it returns, or does the SDK library function handle that?

Does the repeating alarm callback allow for the time it takes to reset the alarm, or does the timing only give roughly 40kHz? If it sets it to go off again in 25us, but it's taken a few dozen clock cycles to get to that point since the timer last went off, I'd expect it to run slightly slow.

TooSlowTube
Автор

Hi these videos are amazing and thankyou so mucho for the knowledge.

I was wondering if there is a problem with add_repeating_timer_us because setting to 25us it seems to do nothing. I am trying to set a sampling frequency in order to work with a DDS as your examples, but oscilloscope do not show anything(it dos not show the square wave expected at 25us using the mentioned function).

LeViir
Автор

I thought the timer counts down - hence you need to write the countdown value into the registry and why putting in a 0 disables a timer...

padcom
Автор

is/are there any python guide/lections ?

Ogi-TV
Автор

he starts to mumble on hardware interfacing? Learning on 8 bit systems where all the interface hardware needs to be developped would be more useful to these students than using a modern include everty thing device. Data sheets need to be understood more between different chip manufacturers. etc.

taipo
join shbcf.ru