Using DMA
#1
Posted 30 September 2010 - 09:29 AM
#2
Posted 30 September 2010 - 02:18 PM
#3
Posted 30 September 2010 - 03:19 PM
Hi GB30,
What exactly are you wanting to do? [Read/write directly to memory locations in the AT91SAM7X512?]
Chris
Exact, for example read directly memory locations.
#4
Posted 30 September 2010 - 10:58 PM
Exact, for example read directly memory locations.
Hi GB30,
You can write a native code class for that and compile it into the firmware if you'd like.
We could also add one directly in the SecretLabs namespace--the big reason we haven't is because we didn't want to introduce any "raw power tools" when the board was brand new (as it would be easy for new users to incorporate drivers with raw register access--and not understand the consequences).
Are there particular features you're looking for?
Chris
#5
Posted 01 October 2010 - 07:35 AM
Hi GB30,
You can write a native code class for that and compile it into the firmware if you'd like.
We could also add one directly in the SecretLabs namespace--the big reason we haven't is because we didn't want to introduce any "raw power tools" when the board was brand new (as it would be easy for new users to incorporate drivers with raw register access--and not understand the consequences).
Are there particular features you're looking for?
Chris
Hi Chris.
My request is refered to have the complete control of AT91.
For example: I want to use low power mode, but I have to write some uP registers; I want to change PLL configuration in order to change clock; I want to use ADC in 8 bit mode or 10 bit mode... and so on.
I would like to control AT91 and then I would like to work in high level: I work in C or assembler so I understand the consequences of raw register access; working with OOP is useful in order to accelerate programming process and interface with PC world.
So is there an example to follow in order to write a native code class for that and compile it into the firmware ?
Thanks a lot
#6
Posted 01 October 2010 - 07:38 AM
#7
Posted 01 October 2010 - 08:14 AM
Actually, register access is rather simple - if I omit code that checks address to prevent access to invalid/reserved areas:I'll also put a "Memory/Register" class down as an official feature request.
// C# Wrapper using System; using Microsoft.SPOT; using System.Runtime.CompilerServices; namespace XXX.NETMF.Hardware { public static class Register { [MethodImpl(MethodImplOptions.InternalCall)] public static extern uint Read(uint address); [MethodImpl(MethodImplOptions.InternalCall)] public static extern void Write(uint address, uint value); } } // Native Code (.cpp) #include "XXX_NETMF_Hardware.h" #include "XXX_NETMF_Hardware_XXX_NETMF_Hardware_Register.h" using namespace XXX::NETMF::Hardware; UINT32 Register::Read(UINT32 address, HRESULT &hr) { // FIXME: Check address UINT32 retVal = *(UINT32*)address; return retVal; } void Register::Write(UINT32 address, UINT32 value, HRESULT &hr) { // FIXME: Check address *(UINT32 *)address = value; }
#8
Posted 02 November 2010 - 08:31 AM
I tried to investigate how can I use Interop in order to integrate low level code with microframework.
I don't understand this :
1) I use wrapper class to microframework. But how can microframework know what kind of microprocessor is working? How can it compile this C or C++ code?
Thanks
Actually, register access is rather simple - if I omit code that checks address to prevent access to invalid/reserved areas:
// C# Wrapper using System; using Microsoft.SPOT; using System.Runtime.CompilerServices; namespace XXX.NETMF.Hardware { public static class Register { [MethodImpl(MethodImplOptions.InternalCall)] public static extern uint Read(uint address); [MethodImpl(MethodImplOptions.InternalCall)] public static extern void Write(uint address, uint value); } } // Native Code (.cpp) #include "XXX_NETMF_Hardware.h" #include "XXX_NETMF_Hardware_XXX_NETMF_Hardware_Register.h" using namespace XXX::NETMF::Hardware; UINT32 Register::Read(UINT32 address, HRESULT &hr) { // FIXME: Check address UINT32 retVal = *(UINT32*)address; return retVal; } void Register::Write(UINT32 address, UINT32 value, HRESULT &hr) { // FIXME: Check address *(UINT32 *)address = value; }
#9
Posted 02 November 2010 - 07:26 PM
Would it be possible to hook the DMA up to external SRAM (obviously not with the current board, but assuming a board with suitably connected SRAM was developed, does the CPU have this capability?
I would like to read and transform a large volume of data very quickly,
something along the lines of this project except that I am looking for an 8-bit colour display and hence a block of SRAM to store the display buffer in (plus other bits)
-(e)
#10
Posted 02 November 2010 - 07:34 PM
#11
Posted 04 November 2010 - 05:24 PM
sweetlilmre, the AT91SAM7X512 MCU does not support external RAM directly. You could add external RAM via SPI, but you'd have to read/write data slowly via the SPI interface.
Chris
Hi,
Thanks for the info. I guess for this particular application I'll need to look at something else like a STM32.
Hmm pity I really like the AT91 chips.
-(e)
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users