Go to advanced search

by nickell8448
Fri Sep 27, 2019 9:40 pm
Forum: Bare metal, Assembly language
Topic: Setting the output register for a GPIO on Pi 4
Replies: 21
Views: 2913

Re: Setting the output register for a GPIO on Pi 4

Thanks for your response Burngate. As far as I understood this was that Pin 10 = BCM 15 and Pin 36 = BCM 16. I am not sure how pin 10 = GPIO 16. You are correct and I should use my glasses when reading datasheets :-) Pin 36 = GPIO 16 Regardless stick to BCM or GPIO numbers we aren't interested in p...
by nickell8448
Fri Sep 27, 2019 9:36 pm
Forum: Bare metal, Assembly language
Topic: Setting the output register for a GPIO on Pi 4
Replies: 21
Views: 2913

Re: Setting the output register for a GPIO on Pi 4

Once upon a time ... when the first Pi was being designed, on the chip they wanted to use they had a range of GPIOs (General Purpose Input/Outputs) that they wanted to bring out to a header. Inside the chip, the registers that accessed them had them in a certain order. This gave rise to the GPIO nu...
by nickell8448
Fri Sep 27, 2019 10:11 am
Forum: Bare metal, Assembly language
Topic: Setting the output register for a GPIO on Pi 4
Replies: 21
Views: 2913

Re: Setting the output register for a GPIO on Pi 4

To understand this well, you state that GPIO16 is pin 10 on the 40 pin header, how did you make that connection? I could not make that connection based on all the reading I have done. Do you any specific resource you would recommend to learn this? https://pinout.xyz/# Thanks for your response Burng...
by nickell8448
Fri Sep 27, 2019 9:54 am
Forum: Bare metal, Assembly language
Topic: Setting the output register for a GPIO on Pi 4
Replies: 21
Views: 2913

Re: Setting the output register for a GPIO on Pi 4

You completely override whatever is on GPFSEL1 .. surely you want to read it mask off the 3 bits and write the function for the pin you are trying to change. At a guess something like this seems more appropriate mov r1, #1 mov r2, #7 lsl r1, #18 lsl r2, #18 ldr r3, [r0] bic r3, r3, r2 orr r3, r3, r...
by nickell8448
Thu Sep 26, 2019 11:36 pm
Forum: Bare metal, Assembly language
Topic: Setting the output register for a GPIO on Pi 4
Replies: 21
Views: 2913

Re: Setting the output register for a GPIO on Pi 4

I updated the code as some threads on the forum suggested that the peripheral memory base address has been updated to 0xFE000000. It still doesn't seem to work. Trying to switch on the LED on pin 16 mov r0, #0xF0000000 orr r0, #0x0E000000 orr r0, #0x00200000 orr r0, #0x00000004 mov r1, #1 lsl r1, #1...
by nickell8448
Thu Sep 26, 2019 8:40 am
Forum: Bare metal, Assembly language
Topic: Setting the output register for a GPIO on Pi 4
Replies: 21
Views: 2913

Re: Setting the output register for a GPIO on Pi 4

Small update on this: the code is working, I was trying to target GPIO 20 pin but this is working with pins 2, 3 and 4. The voltage is high at 2 and dropping to a low-value on pin 4. Would anyone be able to suggest what would be the right MMIO for GPIO 20 and what would be the process to calculate t...
by nickell8448
Thu Sep 26, 2019 1:06 am
Forum: Bare metal, Assembly language
Topic: Setting the output register for a GPIO on Pi 4
Replies: 21
Views: 2913

Setting the output register for a GPIO on Pi 4

Hello, I am newbie to the raspberry pi world and I am trying to learn how can I build some bare metal programs on a raspberry pi. I have a raspberry pi 4 model b and I am trying to change the output register value for a specific GPIO. I tried finding the address of the GPIO but not able to find the ...

Go to advanced search