This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

How to read .ppm file from micro sd card.

Other Parts Discussed in Thread: EK-TM4C1294XL

Hello,

we are using TM4C129X evolution kit . I want to red .ppm file from memory card and want to display on kentec display.but SD_Card example demonstrates the directory structure of SD card on LCD screen. it does not have any function related to open the file.

 when I will use f_open function it will hang the demo kit and go to exit.c file .

Please any one have do this function please guide me how to read file from memory card.

any document available for function explanation?

Thanks & Regards 

  • Hello Priya

    It is no a "evolution kit" but a "evaluation kit". I would suggest using the following TI Design example code which has a sd card example for the EK-TM4C1294XL.

    www.ti.com/.../TIDM-TM4C129SDRAMNVM

    Regards
    Amit
  • Hi

    I am using the TM4c129x Development board.
    I am trying to read.PPM file from memory card using library provided by Texas. During the reading from memory card I found that it’s given perfect value for value less than 128 but if value if >128 then it will read the wrong value from memory card. Is it any conversation required for reading.PPM file?




    Thanks & Regards
  • Hello Priya,

    I am not sure of what a PPM file is? I have used the FatFS implementation to read data which is more than 128 and it works fine.

    Regards
    Amit
  • hi ,

    I am using tivaware sdcard example which use FATFS . But in my case I have to read ASCII Value from ppm file . I got correct value for value <128 but not correct value for >128 . any UTF-8 conversion require ? I have also used this library for text file too, in that case it's work perfect.

    Thanks

  • Hello Priya,

    If you are reading ASCII values, then the value should never be >127 according to the ASCII tables I am familiar with.
  • Hi,

    You may use the methods foun in hex editors: for values over 128 print only a dot. The alternative method, for files with such values is to print every byte as hex value, and get uniform and consistent display.

  • ppm appears to be an image file extension. No ASCII involved.

    Robert
  • Hello Robert

    It is a PNM file that the poster may be referring to. And if it indeed is a text file then there would be ASCII characters only in the file which would be less than 127.

    Regards
    Amit
  • Problem Description:
    hi ...

    I am trying to read ppm file (image) from sd card. I am getting perfect value for the ascii character less than 127 but getting incorrect data for the ascii value more than 127. whats the reason behind this? please provide the solution for this.

    suppose i am reading the text file containg data as follows

    "P6
    # CREATOR: GIMP PNM Filter Version 1.1
    320 240
    255
    œ¯Èœ¯Èœ¯Èœ¯Èœ¯Èœ¯Èœ¯Èœ¯Èœ¯Èœ¯Èœ¯Èœ¯Èœ¯Èœ¯Èœ¯Èœ¯Èœ¯Èœ¯Èœ¯Èœ¯"


    then the problem is i am getting correct data till the ascii value for data is less than 127..
    i am able to read the data till 255 written in the text file but after that i am getting incorrect values for the ascii values greater than 127.

    how this problem can be solved... is it something that it uses some other code or any encoded form to store the values in sd card that are greater than ascii value 127? how to read of write such values or such symbols ????

    thanks in advance. waiting for your reply.
  • thanks in advance. waiting for your reply.

    You should honestly get up, and learn to use a search engine and to investigate at topic by yourself.

    Read the PPM file format specification, for instance here : http://netpbm.sourceforge.net/doc/ppm.html

  • Hi,

    Agree with f.m.

    Also see this:  

  • Also see this:

    An even better documentation - I had just used the first one to turn up in the search engine hit list. I commented that pixel data are binary, but somehow that part got lost ...

    However, I can't help but wondering (not only related to this thread). My still-below-teenage kids (girls) are much more resourceful than a lot of "engineers" here ...

  • Dear F.m

    I have already used that pdf. I have tried a lot than after I have  posted here if you have ans than give it otherwise left it.

    no need for such type of comments

  • I have already used that pdf. I have tried a lot than after I have  posted here if you have ans than give it otherwise left it.

    If that were true, you would have noticed that the pixel data in this kind of PPM file is binary.

    I am trying to read ppm file (image) from sd card. I am getting perfect value for the ascii character less than 127 but getting incorrect data for the ascii value more than 127. whats the reason behind this? please provide the solution for this.

    This quotation from a former post of you clearly contradicts your claim.

    no need for such type of comments

    Quite understand that you don't like it.

  • hi ,

    I know that data is in binary format but I am reading data from particular location it give data in 8 bit(byte) at a time from that location so I am getting equivalent value of ASCII and compare its value to real value of ppm , ppm file is open in one editing software which give its value.


    Thanks
  • That doesn't make any sense. Binary does not have an equivalent ASCII value.

    Robert
  • Hi,

    At least you can post a picture of your "good" file (use the snipping tool on your computer) and a "bad" display - to figure out what's going (wrong) on.