So i've been learning on AVR for a bit, and i've read about *How* UART/SPI work under the hood. However, I feel like I need to implement a simple software version of them to fully understand how they work and what's going on.
I don't know which one would be better/easier to start with. UART "seems" easier, but I seem to see more Soft-SPI Libraries. From my understanding looking at the USART block diagram were taking a clock and doing some clock generation/division to produce a specific baud rate which takes data from a buffer and feeds it into a shift register where it's fed out (Pretending were talking about TX here) MSB first correct? (Leaving out parity/stop bit). Reading the block diagram im a bit confused what UCSRnA,B,C exactly do (Since they just seem to be sitting on the data bus), I mean I know they are various status/control registers but I guess the diagram doesn't go into detail how they interact of course...nevertheless.
Anyways, is this a do-able newbie task? I've read a bit about making sure to sample in the middle of the "bit length". I think probably where I have the most confusion is on timing/latching. IE: Reading/Writing/etc... on clock-edges. For example: If I want to sample at the middle of a clock, or what if I wanted to latch data in on the falling edge im not sure how to do that in software. I understand "what it means" on the hardware side but there is obviously a ton of gaps in my knowledge.
So far i've been able to read datasheets and for the most part understand interacting with them on a basic to semi-intermediate level with the Atmega328p, but I want to understand what's going on underneath as well. I think this is where the gaps in my knowledge are pretty heavy (Im used to Web-Dev land, so I feel like I need to refresh in Computer Architecture a bit tbh).
Anyways, sorry for the ramblings. What's a good start with this for someone like me? IMO it'd be really awesome to build a "Physical" breadboard sort of layout with an actual shift register and buffers and status LEDS for example (Maybe SUPER slowed down) to show the same thing.