Announcement

Collapse
No announcement yet.

micro SD card

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • micro SD card

    I'm using the 32PTU module in serial mode.

    I have font's and images on the micro SD card.
    My program starts everytime with a hardware reset.
    Then I read the data from the SD card.
    Just after powering up, no problem.

    But I'm still in the debugging phase, so I do restarts regulary, without removing the power each time.

    I found out that I have to remove and re-insert the SD card each time before a restart.
    If I do not do this, the file mount returns 0x0000.

    Is there a way to avoid this?

    Thanks,

    Patrice

  • #2


    What make and model of uSD card are you using?

    How are you doing these 'restarts'?

    IS there any activity currently happening on the uSD when you do these restarts? (what is it?)
    Mark

    Comment


    • #3


      This is what is marked on the card: microSD 2GB Transcend.

      Restart: I hold down de reset line for 10 mSec, then back to high. Then I wait for 3 sec, just doing nothing.

      Patric

      Comment


      • #4


        Please try a different brand of uSD card.
        Mark

        Comment


        • #5


          Today I received a microSD card form SanDisk 2GB.
          Problem solved!!

          Is it possible to use disks with a higher capacity than 2GB?
          These becomes very difficult to get.

          Thanks!

          Patric

          Comment


          • #6


            Windows can format up to 4gb uSD cards as FAT or FAT16.

            To use other uSD-HC cards, use RPMET (from the tools menu) to partition the card, refer app note P1001 http://www.4dsystems.com.au/appnotes/
            Mark

            Comment


            • #7
              Really sorry to ask my question in here. I'm using the same uLcd 32PTU, serial interface with SPE.

              My question is: How could i add fonts in SD card and how could i add WAV files as well?

              Thanks a lot. Sorry for my silly question but 2 hours now im trying to search were those info are and cant find any.

              I need to use my own Fonts and add also some .wav files in the SD card.

              Comment


              • #8
                Hi

                This appnote will help https://www.4dsystems.com.au/appnote/4D-AN-00089/ It explains how to use uSD Fonts in the Serial environment.

                You will also find information on page 25 of the Picaso Serial Command Resference Manual https://www.4dsystems.com.au/product...nual_R_2_0.pdf

                On page 130 of the same manual you will find details of the file_PlayWAV command

                I hope this helps

                Best regards

                Paul

                Comment


                • #9
                  Guys, It might be really simple.

                  For you that you know what you are doing and you have played with the 4D screens a lot, it is obvious that is it really simple case.

                  For us that we are using the 4D systems serially, and for me at least that it is the first time i use the SPE serial on the 32PTU, it is like i dont know where to start.

                  First of all, i have an sd card. Mounted on the Screen.

                  I need to pass a simple .wav file on the SD and ask it serially every time i need it.

                  So please lets start from the basics.

                  1. Do i need to install the SD card on the computer? If yes that is fine.
                  2. Then it is that simple to drag and drop the .wav file inside the SD card? If so i have done that and call the file as sound.wav.
                  3. Now lets put it back to the Display.

                  Here it start the nightmare and really the documentation of how to play this file is not understandable to me.

                  I feel really stupid, that i cannot understand that basics.

                  On the page 130 it is only a command that show how to play the file. Which file? how do i get the info of the file inside the SD in order to play it?

                  Apologize for my question once again.

                  Comment


                  • #10
                    ok thanks got it working.
                    Last edited by astasuleo; 19th July 2018, 06:14 AM.

                    Comment


                    • #11
                      Hi,

                      I am glad you got it working, with the brief information I gave you. All commands in the Serial Reference Manual are similar in the way they are called and very powerful so you should be able to carry out a lot of tasks using the Serial SPE environment. Out of all the available commands the file_PlayWAV wasn't really a basic command as it contained a string. Some of the file commands contain a string so it was a good example to get working.

                      Best regards

                      Paul

                      Comment


                      • #12
                        I hope i can help other to understand in the way i do.

                        So if you want to add a.wav file in the SD FAT16 card, you need to plug first the SD in the computer.

                        Then simply drag and drop the wav file in the SD.

                        Lets say your filename is SOUND.WAV

                        Now unplug the card from the computer and install it to the ulcd 32PTU screen, that you already have the SPE configuration.

                        As far as im using an external MCU which in my case is the PIC18F26K22, and the programming language is PBP3 (picbasic pro 3), the following configuration must be applied in order to make the wav file to work.

                        1. First of all we need to establish the communication baudrate the same at the uLCD 32PTU and the microcontroller.
                        In my case it is 38400 bps.

                        To configure the LCD baudrate we need at the WORKSHOP software of the 4D to go

                        1.Options --> Serial and there choose what is better for the uLCD and your microcontroller.
                        In my case i choose 38400 from the WORKSHOP --> OPTIONS --> Serial Environment Initial BaudRate: 38400

                        Or in the picbasic command line you can add this: Only if you havent configured your HSER ports to any baudrate.

                        Code:
                        hserout2[$00,$26,$00,$0A] 'SPE serial graphic interface -SET THE BAUDRATE 38400 bps
                        Hserin2 [wait(6)]
                        The above command it is not needed if you have specified the following configuration for the HSER PORT.

                        Code:
                         DEFINE HSER2_RCSTA 90h ' Enable serial port & continuous receive
                                DEFINE HSER2_TXSTA 24h ' Enable transmit, BRGH = 1
                                DEFINE HSER2_CLROERR 1 ' Clear overflow automatically
                                DEFINE HSER2_SPBRG 160 ' 38400 Baud @ 64MHz, -0,08%
                                SPBRGH2 = 1
                                BAUDCON2.3 = 1         ' Enable 16 bit baudrate generator
                        Then, for me it worked as follows.

                        1. I set a volume
                        2. I set the MOUNT FILE command.


                        Code:
                        HSEROUT2 [$FF,$00,$00,$46]  ' SOUND VOLUME to 70
                        Hserin2 [wait(6)]
                        HSEROUT2 [$FF,$03] ' MOUNT FILE, this is very imporntat command in here. 
                        Hserin2 [wait(6)]
                        Then i send via HSER the following command.

                        Code:
                        HSEROUT2 [$00,$0B,"SOUND.WAV",$00]
                        Hserin2 [wait(6)]

                        Comment


                        • #13
                          Thanks for the detailed explanation, I am sure it will be very helpful to others.

                          Best regards

                          Paul

                          Comment


                          • #14
                            Hi Paul,

                            i have one more question. Reading this document https://www.4dsystems.com.au/downloa...0089_R_1_0.pdf,

                            i was able to add some new fonts in the SD card. Im using SPE environment on the 32PTU.

                            Unfortunately i cant make it work.

                            Could you please guide me what are the commands to use in order to load the New font from the sd card.

                            I have loaded 8 different Fonts. Lets say i would like to use the 7th. So inside SD card it appears as follows.

                            1 FONTST~2.d07
                            2 FONTST~2.g07

                            So i understand that i need to load those files from the SD using 3 commands:

                            file_MOUNT
                            LOADImageControl
                            txt_FONTID

                            Code:
                            HSEROUT2 [$FF,$03] ' MOUNT FILE, this is very imporntat command in here.
                            Hserin2 [wait(6)]
                            HSEROUT2[$00,$09,"FONTST~2.d07","FONTST~2.g07",$00,$01] ' SPE serial graphic interface - CALL FONT from SD
                            Hserin2 [wait(6)]
                            HSEROUT2[$FF,$E5,$14,$1C] ' SPE serial graphic interface - SET FONT
                            Hserin2 [wait(6)]
                            But really i do not get anything on the Display. I also sent a command with string, i havent included on the above code.

                            Could you help?
                            Last edited by astasuleo; 21st July 2018, 09:00 AM.

                            Comment


                            • #15
                              Hi,

                              It may be that the handle used to set the font is not correct. The handle will be 2 bytes after the ACK which you recieve but you should also take the next 2 bytes that are sent,

                              Maybe like this (sorry I don't know much about PIC Basic)

                              Code:
                              HSEROUT2 [$FF,$03] ' MOUNT FILE, this is very imporntat command in here.
                              Hserin2 [wait(6)]
                              HSEROUT2[$00,$09,"FONTST~2.d07","FONTST~2.g07",$00,$01] ' SPE serial graphic interface - CALL FONT from SD
                              Hserin2 [wait(6)]
                              f7hi = Hserin2 [wait()]
                              f7lo = Hserin2 [wait()]
                              HSEROUT2[$FF,$E5,f7hi,f7lo] ' SPE serial graphic interface - SET FONT
                              Hserin2 [wait(6)]
                              It is possible, that if the font id is wrong you might not get the ACK (6) that you wait for with the Hserin2 command.

                              I hope this helps

                              Best regards

                              Paul

                              Comment

                              Working...
                              X