Hello,
We bought ARM CM0+ deliverables from ARM. I want to design an SoC which has to get data from an another system .The aim of the SoC is to process an array of 4096 samples received from the external world.For the data interfacing, we are using GPIO interface IPs provided by ARM as part of deliverables.
Can anyone explain how the GPIO works in CM0+ and how to program in C?
Thanks,
Sabarish
Hi Simon,
Thank you for your reply.
In cortex m0+ system design kit deliverables provided by ARM, there is a .h file which contains the memory map of the processor. From that, I know the address of the registers of GPIO port registers which contains Data, DataOut, Interrupt Set Registers, Interrupt Type Registers, interrupt polarity registers and data mask registers. The ports are of 16 bits
For our SoC, the data from external world comes at 1ms interval. I want to program the processor such that data coming from the port will store in array and do the processing later on.
My doubt is how to program the GPIO port for that time duration.
--
Sent from Mail.Ru app for Android Thursday, 13 October 2016, 05:23PM +05:30 from sim community@arm.com :
>How to use GPIO interface IPs of ARM Cortex M0+
>reply from Simon Craske in Community Help - View the full discussion
If the system is purely time based, then you may want to look at the SysTick example from CMSIS: Systick Timer (SYSTICK)
This results in the SysTick_Handler() function being called on a periodic basis. It should be a simple task to add a global array and an index value, and then to update the SysTick_Handler() so that it reads a value from the GPIO, appends it to the global array, increments the index, and if the index is a certain value, reset the index and perform the necessary work on the array.
You may also want to replace the final "while(1);" in the example with "while(1) __WFI();", which will cause the CPU to sleep until the next SysTick interrupt.
hth
Simon.
Thank you for your reply. It was so helpful. I have some further queries regarding the Systick Timer.
As you said, I am copying the data from GPIO port to an array as global Variable. Actually, I need to write the code to manipulate the array when the index reaches 4096. So, there are two things to be happened in parallel,
1) I need to get the data from outside world at 1ms interval
2) I need to process the array when index reaches 4096.
My issue here is how to do two operations at a time. What I meant is the data should be written continuously into an array and at the same time, it has to do the operations on the array when index reaches 4096. So how to do parallel processing.
Anyone, Could you please suggest me any idea.
Regards,
Sabarish.