Is it possible to read PA0....PA15 into one single variable,
I guess you would call these two bytes UInt
Is it possible to multiply two UInt-s ?
Is it possible to output PB0....PB15 from one single UInt variable ?
Is it possible to store hundreds of such UInt measurements into the large ARM memory
Best regards
BO
ARM 16 bit Input Outbut and mult
Moderator: Benj
- LeighM
- Matrix Staff
- Posts: 2178
- Joined: Tue Jan 17, 2012 10:07 am
- Has thanked: 481 times
- Been thanked: 699 times
- Contact:
Re: ARM 16 bit Input Outbut and mult
Yes, read the port halves as bytes and then form the uint result You could do it faster with C codeIs it possible to read PA0....PA15 into one single variable,
Code: Select all
FCV_UINTVAL = GPIOA->IDR;
Yes, but you would need a ULONG resultIs it possible to multiply two UInt-s ?
Similar to the read, you could do this in two bytes.Is it possible to output PB0....PB15 from one single UInt variable ?
You could also do this as C code (but you would first need to set the port to output mode) ...
Code: Select all
GPIOB->ODR = FCV_UINTVAL;
Yes, just create a UINT array in Flowcode by adding its size: array[1000]Is it possible to store hundreds of such UInt measurements into the large ARM memory
Last edited by LeighM on Tue Apr 25, 2017 12:49 pm, edited 1 time in total.
-
- Posts: 111
- Joined: Wed Mar 02, 2016 11:26 am
- Has thanked: 43 times
- Been thanked: 22 times
- Contact:
Re: ARM 16 bit Input Outbut and mult
Very helpful, thanks !
Would it be possible to transfer such a big measurement array over UART -USB serial communication
to a PC computer, and make this in the background, allowing the processor to work full speed
collecting the next array ?
I think that the hardware UART also has a hardware buffer that might be of help.
Best regards
BO
Would it be possible to transfer such a big measurement array over UART -USB serial communication
to a PC computer, and make this in the background, allowing the processor to work full speed
collecting the next array ?
I think that the hardware UART also has a hardware buffer that might be of help.
Best regards
BO
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: ARM 16 bit Input Outbut and mult
Hello,
The easy way would be to use a circular buffer to store the data as you are sampling and then shift the data out on a regular basis using a transmit interrupt or a timer interrupt.
The harder yet more capable way would be to use DMA to do the shifting out for you. However I would imagine this would require a lot of playing around and C code. As far as I know it's not something we have played with so we wouldn't be able to advise on this and you may have to start reading the various documentation and examples to get to grips with this.
A Flowcode DMA component would be ideal but from playing with DMA in the past I know its an absolute can of worms and really hard to do right and cover all bases. Still as a scientist anything is possible .
We have a resident ST Arm expert who may know more about these types of thing but he is currently away on holiday. I will ask him about it when he gets back to see what he would advise. Leigh may also know more but he is pretty snowed under at the moment with other projects.
The easy way would be to use a circular buffer to store the data as you are sampling and then shift the data out on a regular basis using a transmit interrupt or a timer interrupt.
The harder yet more capable way would be to use DMA to do the shifting out for you. However I would imagine this would require a lot of playing around and C code. As far as I know it's not something we have played with so we wouldn't be able to advise on this and you may have to start reading the various documentation and examples to get to grips with this.
A Flowcode DMA component would be ideal but from playing with DMA in the past I know its an absolute can of worms and really hard to do right and cover all bases. Still as a scientist anything is possible .
We have a resident ST Arm expert who may know more about these types of thing but he is currently away on holiday. I will ask him about it when he gets back to see what he would advise. Leigh may also know more but he is pretty snowed under at the moment with other projects.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel