-
Re: How to address the UART
LenReinhart Feb 24, 2015 5:12 PM (in response to awcrooke)There is an article on the RPi forum on using bare metal on the Pi2. It looks like the base address changes between the Pi and Pi2. I don't know if that will help. http://www.raspberrypi.org/forums/viewtopic.php?f=72&t=98904&hilit=UART
-
Re: How to address the UART
clem57Feb 24, 2015 6:24 PM (in response to awcrooke)
https://github.com/Pieter-Jan/PJ_RPI
Has the code you need!
http://www.raspberrypi.org/wp-content/uploads/2012/02/BCM2835-ARM-Peripherals.pdf
This is the datasheet for the RPi but not the new RPi-2!
On p177 I see incorrect address, but use the names on the sheet and the include from source above and you should be fine!
Cheers,
Clem
-
Re: How to address the UART
awcrooke Mar 1, 2015 8:46 PM (in response to clem57)I've been using that article and looked at the header file, which works with the GPIO pins but there is no reference to the uart.
-
-
Re: How to address the UART
clem57Feb 24, 2015 7:43 PM (in response to awcrooke)
For Linux.
Peripherals base address for older models was 0x20000000, base address for Pi 2 is 0x3F000000. Then add 0x7e20100 to get the correct address for UART registers...
Probably won't affect you but memory was at bus address offset 0x40000000 for older models, bus address offset is 0xC0000000 for the Pi 2.
I've been using the article by Peter Jan " Low level programming the Raspberry Pi in C". this was very helpful and I was able to get his program working to toggle I/O pins. My interest is to use the UART to produce control for DMX512 Lighting. It should be possible top get the required 250 KHz baud rate by setting the clock to 16Mhz. Unfortunately he doesn't give an example program for the uart. The "data sheet" he uses seems to have a typo in the base address for the UART: 0x7e20100, which is missing one digit. I tried 0x7e201000, but that didn't work. Finding the correct address by trial and error has not been productive, (possibly due to an error in my code?). but it would be helpful to start with the correct address. Anyone know the correct address for the UART?