- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Hi,
Can someone tell me how to read and write data to specified memory address like 0x02000001 and so on. I'm programming with Eclipse and I declare an array like: unsigned char buff[256][512]; I wanna write data in this array and after that I want to take the values from memory, so I have to know memory range. Can anyone help me with this? Regards Kycasコピーされたリンク
6 返答(返信)
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
You can use pointers for that. You can assign an address to a pointer.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Thank You for an answer
Can you show an example how to do with pointers, I'm not very good at C and I dont know how to use these pointers :) Or maybe it will be Ok if I just use IOWR_8DIRECT() for example?- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Something like this should work:char *mypointer = 0x02000001;
*mypointer = ...;
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
Great!
One more thing, should I just put all array of data with one IOWR() function, or should I make a loop and write byte by byte to memory?- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
It depends on your needs. Doing a 32-bit operation with a IOWR() or an (unsigned) int pointer will give you better performance than writing byte per byte.
- 新着としてマーク
- ブックマーク
- 購読
- ミュート
- RSS フィードを購読する
- ハイライト
- 印刷
- 不適切なコンテンツを報告
I think the same thing. I have char type data, so I'll use IOWR_8DIRECT() with a loop.
Oh and one more thing, if I declare some variables with value for example: float c[3][3] = {{1,1,1}, {1,1,1}, {1,1,1}}; I think that this "c" will be put in SDRAM and if I write date with IOWR() function from the beginning of memory lets say. Won't the data that I want to write overlap the declared data "c"? Its kind of confusing with this to me...