Hi Peter, please send us your full sample file so we can try it and find 
the problem.

I don't know if your variable teller and molen[] are defined as a byte or a 
word. Also if array molen isn't large enough you will get wrong 
information. Since we don't have this information it is hard for us to find 
the problem.

I see you are writing to the sd card with  sd_start_write to sector 30. You 
won't be able to read the file from windows unless you want to use fat32. 
If you don't want to read the data into windows you don't need fat32 so you 
can continue with what your using.

Old sd cards do need a delay. If you are using an old sd card smaller than 
4gb you can turn this on before "include sd_card":
const bit SD_DELAY_AFTER_WRITE = TRUE

Matt.

On Monday, September 19, 2022 at 1:54:58 PM UTC-4 [email protected] wrote:

> Hi Peter,
>
> I still have a problem understanding your problem but I am not an SD card 
> expert and do not know is you need delays for writing to an SD card. Could 
> be but maybe Matt knows.
>
> I also see you are using two serial ports, is that right? That should not 
> be a problem but I was just wondering if that was on purpose.
>
> Kind regards,
>
> Rob
>
> ------------------------------
> *Van:* [email protected] <[email protected]> namens ZetWeeh <
> [email protected]>
> *Verzonden:* zondag 18 september 2022 17:26
> *Aan:* [email protected] <[email protected]>
> *Onderwerp:* RE: [jallib] Sample of Matt for SD with fat 32 and problem 
> with hex file 
>  
>
> Hi Rob
>
>  
>
> Thanks for your answer.
>
> I use serial software with baudrate 115200. This is only for seeing what 
> is happening.
>
> Writing to the SD card is by SPI.
>
> I use this code:
>
> ;sd_start_write(30)          --get sd card ready for write at sector 30
>
> ;    for count(molen) using teller loop
>
> ;        sd_data_byte = molen[teller]
>
>  
>
> *;        format_dword_dec(serial_sw_data,teller,3,0)*
>
> *;        print_string(serial_data, " ")*
>
> *;        gegeven = molen[teller]*
>
> *;        print_byte_hex(serial_sw_data,gegeven)*
>
> *;       print_string(serial_data, "    ")*
>
>  
>
> ;    end loop
>
> ;sd_stop_write
>
>  
>
> The cursief part I made when I saw the problem by reading  the SD card.
>
> So without the cursief part I noticed the problem.
>
> I too read the file on the SD card in Windows to be sure where was the 
> problem.
>
> When I copy the file to the SD card in Windows: it works fine.
>
> I suppose the delay is coming after
>
>  
>
> sd_data_byte = molen[teller]
>
>  
>
> but how long?
>
>  
>
> Kind regards,
>
> Peter
>
>  
>
> Verzonden vanuit Mail <https://go.microsoft.com/fwlink/?LinkId=550986> 
> voor Windows
>
>  
>
> *Van: *Rob CJ
> *Verzonden: *zaterdag 17 september 2022 17:37
> *Aan: *[email protected]
> *Onderwerp: *Re: [jallib] Sample of Matt for SD with fat 32 and problem 
> with hex file
>
>  
>
> Hi Peter,
>
>  
>
> I do not have enough information to answer your question. Which serial 
> library are you using? Do you have a delay in writing to the  serial 
> interface since the SD card will be much faster than the serial interface 
> and it might be that your computer is not able to keep up with it.
>
>  
>
> Kind regards,
>
>  
>
> Rob
>
>  
>
>  
>
>  
>
> *Van:* [email protected] <[email protected]> namens Zet Weeh <
> [email protected]>
> *Verzonden:* donderdag 15 september 2022 11:40
> *Aan:* jallib <[email protected]>
> *Onderwerp:* [jallib] Sample of Matt for SD with fat 32 and problem with 
> hex file 
>
>  
>
> Hi everybody 
>
>  
>
> I have a picture in hex that is working fine on an oled.
>
> I want to use it on a sd-card that's build in ILI9341.
>
> When I use the sample of Matt I can write and read all of the sample; so 
> it's 
>
> working fine.
>
> The hex file is 500 bytes so one cluster.
>
> When I want to write and read the hex to the SD I can see in RealTerm
>
> that the writing is going fine till byte 400 and then it becomes a mesh.
>
> I changed the baudrate but that did not help. Has anybody a suggestion 
> what is going wrong and what to do?
>
> Peter
>
>  
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "jallib" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jallib/21e71303-1a48-4696-95fb-cb227a8ffcaen%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/jallib/21e71303-1a48-4696-95fb-cb227a8ffcaen%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "jallib" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jallib/GVXP195MB16371DFB89BCD321725341C7E64B9%40GVXP195MB1637.EURP195.PROD.OUTLOOK.COM
>  
> <https://groups.google.com/d/msgid/jallib/GVXP195MB16371DFB89BCD321725341C7E64B9%40GVXP195MB1637.EURP195.PROD.OUTLOOK.COM?utm_medium=email&utm_source=footer>
> .
>
>  
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "jallib" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/jallib/14191E31-FBE0-4539-8CF5-059E1C7ED497%40hxcore.ol
>  
> <https://groups.google.com/d/msgid/jallib/14191E31-FBE0-4539-8CF5-059E1C7ED497%40hxcore.ol?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jallib/313c2693-b1f6-4a9a-94d4-69ac0a9a2264n%40googlegroups.com.

Reply via email to