Raspberry Pi: Difference between revisions

[unchecked revision][unchecked revision]
Line 98:
Start with a single simple querry at first and then build up more complex mails. If you get it working then I recommend just altering the virtual size and color depth and leaving the physical resolution as is. The RPi seems to do a fine job of detecting the monitor and the user can also configure a resolution in the boot config files on the SD card. Best to honor his wishes.
 
==Interrupts and exceptions ==
 
By default the exception vector table on ARM starts at 0x0. You can use that but there are better ways. You can set a flag to use a high vector at 0xffff0000 or set the exception vector base address register to point to your own table anywhere (32byte aligned) you like.
 
Note: Interrupts are level triggered so you have to clear the source of an interrupt or mask it before returning from interrupt. The ARM cpu in the RPi also supports some extra instructions for storing registers on the stack of a different mode, switching modes and returning from interrupt. Those extensions are nicely described in the ARM arm.
 
Note: The return address in LR during an interrupt will be 0-8 byte, depending on the type of exception, offset to what it should be and needs to be adjusted before returning. Again look into the ARM arm for which offset applies to which exception.
 
Implementing and testing the software interrupt first is a good idea since you can trigger it in a controlled way.
 
When configuring some peripheral to send an interrupt it is a usefull thing to have interrupts disabled in the CPSR, enable the interrupt you are interested in (or all) in the 3 interrupt enable registers and then poll the 3 pending registers in a tight loop and output changes. This allows you to see if the peripheral raises an interrupt and (if in doubt) which one. After that the real interrupt handler can be configured and tested. Gives you a nice half way point to test what you have so far.
 
==USB==
 
Anonymous user