# New quiz in Ziglings - Bit manipulation in embedded devices

**URL:** <https://ziggit.dev/t/new-quiz-in-ziglings-bit-manipulation-in-embedded-devices/8552>\
**Category:** News\
**Tags:** learning\
**Created:** [February 13, 2025, 10:38pm UTC](https://ziggit.dev/t/new-quiz-in-ziglings-bit-manipulation-in-embedded-devices/8552 "2025-02-13T22:38:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrboesch](https://ziggit.dev/user_avatar/ziggit.dev/chrboesch/32/438_2.png) [@chrboesch](https://ziggit.dev/u/chrboesch)\
**Post date:** [February 13, 2025, 10:38pm UTC](https://ziggit.dev/t/new-quiz-in-ziglings-bit-manipulation-in-embedded-devices/8552/1 "2025-02-13T22:38:01Z")

</div>

Quiz time again at Ziglings, this time it’s about bit manipulation in embedded devices. All your Zig skills are needed to help fix the errors! Many thanks to our new contributor [@alexsisco](https://codeberg.org/alexsisco) who created this exercise.

```zig
// ============ PINOUT DIAGRAM FOR ATMEGA328 MICROCONTROLLER ============
// __________
// | U |
// (RESET) PC6 --| 1 28 |-- PC5
// PD0 --| 2 27 |-- PC4
// PD1 --| 3 26 |-- PC3
// PD2 --| 4 25 |-- PC2
// PD3 --| 5 24 |-- PC1
// PD4 --| 6 23 |-- PC0
// VCC --| 7 22 |-- GND
// GND --| 8 21 |-- AREF
// |-- PB6 --| 9 20 |-- AVCC
// |-- PB7 --| 10 19 |-- PB5 --|
// | PD5 --| 11 18 |-- PB4 --|
// | PD6 --| 12 17 |-- PB3 --|
// | PD7 --| 13 16 |-- PB2 --|
// |-- PB0 --| 14 15 |-- PB1 --|
// | | ___________ | |
// \ _______________________________ /
// |
// PORTB
//

```

[Ziglings.org/Quiztime](https://codeberg.org/ziglings/exercises/src/branch/main/exercises/110_quiz9.zig)

---

<div class="post-metadata">

**Author:** ![jeffective](https://ziggit.dev/user_avatar/ziggit.dev/jeffective/32/3116_2.png) [@jeffective](https://ziggit.dev/u/jeffective)\
**Post date:** [February 14, 2025, 4:57am UTC](https://ziggit.dev/t/new-quiz-in-ziglings-bit-manipulation-in-embedded-devices/8552/2 "2025-02-14T04:57:57Z")

</div>

I think this is also a use case for volatile pointers to packed structs?
