Announcement

Collapse
No announcement yet.

Using External SPI port and MicroSD together ?

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

  • Using External SPI port and MicroSD together ?

    Good evening all...



    I wanted to ask for some advice on how to properly use an external SPI bus while also using the internal MicroSD card. I have a uLCD-32PT device, (and can't wait to get my hands on the new 4.3" display) and wanted to connect several MAX6675 K-type temperature IC's and show the data.



    I went through the PDF manuals on the internal functions supporting SPI and all of them seem to affect the SDCS pin going to the SD card. Is there a way to use the internal 4GL SPI control functions to talk to the MAX chips while using the SD card at the same time..?



    The only way I can see so far is to get the SDCS signal from the display bord by cutting the trace and mixing this signal (using an AND gate) with one of the general I/O pins, to form the CS signal for the SD card. Return the AND gate output signal to the cut trace leading to the SD card CS signal. In this way I should be able to select where the SDCS signal gets applied. To add more SPI device selects, just repete to curcuit using more I/O's for each SPI device you have. If you have many devices, you could even use one of the many types of I/O epander IC's so you don't use up as much of the display I/O pins.



    But, doing it this way involves modifying the display board. Is there a way to get the external SPI CS signals I need without trace cutting..?



    Thanks for your time..!



    jea
    "Questing the Killer 4D App"

  • #2


    Greetings Jea,

    One of our support staff will assist in answering your tech questions. Regarding availability of the ?LCD43, we are now live!!!
    You can purchase from our online store: http://shop.4dsystems.com.au/

    Regards,

    Sinan

    Comment


    • #3


      You bet Sinanaknar ! next paycheck that comes around, the order will be in you in box..! would still like to use the SPI port externaly... anyone tried this..?
      "Questing the Killer 4D App"

      Comment


      • #4


        Not sure how fast or frequent you need to get updates from the MAX6675's
        but it might be a better proposition to bit bang an SPI port with other pins.
        That way you dont need to modify the board, and there will be no contention
        between you hardware readings and the uSD card functions.
        Regards,
        Dave

        Comment


        • #5


          Yep, Sounds like a good way to get it done... I dont need a rapid repeat rate on the temps coming in anyway. You gentelman did a geate job doing the 4D Visi addon to the IDE software.! It's got me wondering what the GUI radio button is going to do... (nice) Keep up makeing more wigets, They look and work great..!!



          jea
          "Questing the Killer 4D App"

          Comment


          • #6


            A little late to the party, but I bit banged a the MAX 6675 without any problems using the general IO pins IO2, IO3 and IO4

            Comment


            • #7


              Sweet...! I just got 4 of the IC's in today from Digi-key (ouch.. $14 a copy) and will be mounting two of them to a converter board so I can play around with them. I would like to them read on a timer based ISR and maintain the "C" and "F" numbers automatically so I could just read the most current answers when needed. Not sure what the magic line of code to properly get the bits arranged and converted to the needed output var's yet... I did get a little time to skim over the PDF for the chip. Bit 2 detects an open sensor circuit and is an important feature to include... (nice)



              Thanks for trying this out ahead of time..!!!



              I am trying to get this setup to monitor engine temps and would like to add on things like RPM and battery voltage ect... I was also thinking of maybe making this thing in two parts. Ma be a "Potted Module" type of thing next to the engine, connected to all the sense points, with a cheap MCU (PIC Z8..) and have that module provide power and serial com back to the 4D Display device with a simple "Phone Jack" type wire. Still looking things over.... I am kinda of a NUB when it comes to "C" code, But everyone has good examples to look at in the forum which makes things easier...



              Now if 4D starts offering some display mounting frames for there units, I could get the the casing work started, and maybe this thing will start coming together..!!!



              Thanks 4D for creating a "Kick-Ass" product line..!!

              You guys are helping everyone create mini-GUI stuff that looks good..!!



              jea
              "Questing the Killer 4D App"

              Comment


              • #8


                Jea, thanks for the kind words . There's a lot happening here at 4D, more new products, more new tools and bezels for many of the displays is on top of the list. Won't be too long now, we're hoping for a February release.
                Atilla

                Comment


                • #9


                  Here is the simple lib I used with the MAX6675. I hope it helps. It should be renamed to max6675.lib. This forum doesn't allow files with a .lib extension to be uploaded, so I had to rename it.






                  Attached files max6675.4dg (4 KB)

                  Comment


                  • #10


                    Thanks engicoder for the code sample..! I was trying to get the data out of the declared var's that are used but keep getting the var not declared error when compiling... I setup a 1 sec timer to make the call to the MAX6675_Read function, but then can't get the data... I'm sure this is a "Noob" C coding problem with me not knowing enough yet thing... when you get time, could you write a sample snipet showing how to get the data from the var's...?



                    A big thank you in advance for your time my frend..!!!



                    I commented out the lines giving me errors here...



                    func read_ic_data()
                    sys_SetTimer(TIMER0,1000); // read IC every second
                    if (MAX6675_Read) // Read temp IC, Returns 1 if OK
                    //CHT1_Value := pTempDegrees; // update Temp Value
                    txt_MoveCursor(19,1); // reset cursor to line 19, column 1
                    //print ([DEC2]pTempDegrees); // Print it on screen
                    txt_MoveCursor(20,1); // reset cursor to line 20, column 1
                    print ("good ");
                    else
                    txt_MoveCursor(20,1); // reset cursor to line 20, column 1
                    print ("error");
                    endif
                    endfunc
                    "Questing the Killer 4D App"

                    Comment


                    • #11


                      You need to declare the each parameter and then pass it during the function call. Here is a simple example which does something along the lines of what you were trying to do.






                      Attached files max6675-test.4dg (655 B)

                      Comment


                      • #12


                        Excellent..!! Thanks for the help in getting me started up. I wanted to let everyone know on the forum that if I can be of any help, I will.!! I am kind of a hardware guy but have my own copy of Eagle CAD pro and can work up any kind of add-on board we need for the display units. I have attached a sample of a recent LCD display board I did up for a battery pack testing machine at work.



                        Maybe we can work up several types of "standard" 4D display interface boards that just "plug in" to the units making things easier for everyone. If you think this is a good thing, maybe we could open a new thread in the forum, and start gathering data on what people want, and crank out a few boards to use. I could post the output board design data so anyone could get there hands on it...



                        Just a thought.... Thanks again engicoder..!!



                        jea


                        Attached files
                        "Questing the Killer 4D App"

                        Comment


                        • #13


                          NICE..!! I got it working...


                          Attached files .jpg]
                          "Questing the Killer 4D App"

                          Comment


                          • #14


                            Iteresting points from both of you,
                            theoretically, if device chip select is shared (or more to the point disabled while alternative devices are accessed)
                            ,......all should work seamlessly.
                            Seems like zonker got it working, so gladly theory spills over into reality,
                            Please keep us posted on your success
                            Regards,
                            Dave

                            Comment


                            • #15


                              I used 4 MAX6675 simultaneously using a separate IO line for each chip select. The problem you run into on the PICASO is the limited number of general purpose IO lines, but this can be overcome using the bus pins as chip select. In this way you could have up to 8 chip select devices on an bit banged spi line. My previous example code was a simplified version to demonstate a single line.



                              Ben

                              Comment

                              Working...
                              X