- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Assume there is hex file name test.txt saved in SD card. File data is like 0A 23 43 .............
I would like to read all the codes throgh em componet. Pls assist me how can this activity perform.
Solved! Go to Solution.
- Labels:
-
PSoC 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
File is file, there is no difference.
You just need to open the file and retrieve the information stored within. Different from windows OS there are no assumptions regarding the file extension.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Right click on the emfile component and select "find code example"
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
that example i have gone through, but the requirement is different. I need to read code file stored in SD card with extension .txt and wrote with hex characters.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
File is file, there is no difference.
You just need to open the file and retrieve the information stored within. Different from windows OS there are no assumptions regarding the file extension.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Understood, but the fundamental question is still like this:
For ex. if file contains ABCD.... like texts, i understands that microcontroller reads this in ascii code
But if the file contails hex numbers like 0A, BA, FF ........then what shall it be read? ascii of 0, ascii of A or ........
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
For ex. if file contains ABCD.... like texts, the µC will read 0x41, 0x42, 0x43, 0x44...
The interpretation that this might represent the characters 'A' to 'D' is only yours.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
understood but what shall i will read if the file itself contains 0x0A, 0x0B or even 0x41, 0x42 etc instead of ABCD......... My aim is to read the same hex code saved in text file to psoc3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
hope this time i have explained the requirement to you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You will always read the same hex code. I try to explain to you that a file is just a stream of hexadecimal data organized in bytes. The interpretation what the data stand for (Text, ASCII, UTF-8, float numbers) happens after the reading.
Bob