babbleberry / rpi4-osdev

Tutorial: Writing a "bare metal" operating system for Raspberry Pi 4
https://www.rpi4os.com
Creative Commons Zero v1.0 Universal
3.37k stars 246 forks source link

Explanation - part 14 - Active LOW #35

Closed greenonline closed 1 year ago

greenonline commented 1 year ago

On part 14, you state:

Through a bit of trial & error I discovered that when GPIO08 is clear, the device is selected, and when it’s set, the device is deselected. If you can explain this to me, I’d love to hear from you - frankly, I was just pleased to get it working, so I moved on!

This is because the Chip Select pin on the ENC28J60 is active LOW, so the board, upon which the IC is placed ,just brings this pin out, without using an invertor (to save costs). You can see that the ENC28J60 is active LOW by looking at the datasheet of the ENC28J60: Note the /CS pin - the bar denotes active LOW. Hence GPIO08 must be LOW to enable the IC.

babbleberry commented 1 year ago

Nice explanation, thank you! Coming in next commit 😄