Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 14 of 14

Thread: Sparkfun LCD module w/daughter board

  1. #1
    Senior Member Pensive's Avatar
    Join Date
    Aug 2014
    Location
    Basingstoke, UK
    Posts
    562

    Sparkfun LCD module w/daughter board

    Hi all

    How does the Sparkfun GLCD module play on a teensy?

    Device:
    https://www.sparkfun.com/products/9351

    Custom firmware:
    http://sourceforge.net/projects/serialglcd/

    Code library:
    http://playground.arduino.cc/Code/SerialGLCD

    I am after one pre-flashed if possible - does anyone know if sparkfun have adopted the superior firmware?

    Rgds

    Jon

  2. #2
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,415
    Not sure which Teensy you are wanting, but my guess it would work...

    Not sure what you are saying about preflashed or superior firmware...

    A quick look at their library on source forge shows that the code is specifically setup to work on the Serial port. Which on things like the Teensy 3/3.1 and many others is probably not what you would want. If it were me, I would hack up the library, and maybe pass in something like a print object to the constructor and change all of the methods to use this instead of hard coded Serial.

    Edit: reread and looked at alternate code. I am pretty sure that Sparkfun has not adopted this code base, as they probably want the code in the backpacks to work with all of their displays.... But could be wrong. I did not compare the firmware up on github with the more advanced version. My guess is that if you want that alternate firmware, you will need to reflash the atmega that is on the backpack.

    Kurt
    Last edited by KurtE; 09-07-2014 at 04:17 PM.

  3. #3
    Senior Member Pensive's Avatar
    Join Date
    Aug 2014
    Location
    Basingstoke, UK
    Posts
    562
    Interesting; the reason I want to use this is so I can connect the display using 2 pins. I already have a ps/2 keyboard, the audio board and a couple of i2c led drivers to connect up so I'm running low on pins.

    With your response above, do you mean hack it to use i2c instead of serial?

  4. #4
    Senior Member+ KurtE's Avatar
    Join Date
    Jan 2014
    Posts
    5,415
    Nope, by hack, I just meant to set it up to be able to use any Serial port on the Teensy/Arduino...

  5. #5
    Senior Member Pensive's Avatar
    Join Date
    Aug 2014
    Location
    Basingstoke, UK
    Posts
    562
    Ahhhhh, I see. I assume that multiple serial ports are fairly unique to the teensy. My first arduino!

    Beginning to think another teensy with a standard GLCD, hard wired with a known working library would be a better bet. The attraction of this product was the relative simplicity but perhaps it would not be as simple as it seemed.

    Thank you

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,553
    I looked at this code briefly. It seems ok, except you'll probably want to edit this line:

    Code:
    //initialize an instance of the SoftwareSerial library
    SoftwareSerial serial(2,3);//change these two pin values to whichever pins you wish to use (RX, TX)
    To something like this:

    Code:
    // use a real serial port, instead of SoftwareSerial
    #define serial Serial1
    Of course, if using Serial1, connect to pins 0 and 1, not pins 2 and 3.

  7. #7
    Senior Member Pensive's Avatar
    Join Date
    Aug 2014
    Location
    Basingstoke, UK
    Posts
    562
    Thank you! That sounds a little simpler

    I'm still determining my pin outs, once I have it will dictate whether I go for the standard GLCD or the sparkfun with daughter board solution.

    Not sure I like the idea of flashing a brand new functional product via a cobbled up parallel port cable, although I'm confident it will work ...

  8. #8
    Senior Member Pensive's Avatar
    Join Date
    Aug 2014
    Location
    Basingstoke, UK
    Posts
    562
    Thanks for your help guys, it's good to know most solutions can be made to work

    Ultimately I decided to go with this one:

    http://www.hobbytronics.co.uk/lcd/tf...cs-lcd-rgb-neg

    I dropped a few LEDS off my project board to accomodate the 5 digital pins required for it. (between 8 and 12 LEDs I can live without if I have a decent display).
    It also needs 3 more digital pins for the RGB backlight (or one if you just want to use R, G or B).
    And costs me 1k of ram for the buffer (not necessary with a daughterboard serial solution)

    BUT

    It'll run straight off the Teensy 3.1 3.3v, without any additional gear except perhaps the odd resistor
    No faffing with firmware on serial boards and customising a library, my project is already becoming more complicated than it should be.
    cheaper too
    Probably faster, although the Teensy now needs to shift actual data instead of just serial commands...neglible difference here. More CPU cycles taken up at a pinch...?

    and working source with precedent working solution here:
    https://www.pjrc.com/teensy/td_libs_ST7565.html

    I'm already drowning in all the different facets of my project, this simplifies my world as far as electronics goes and is a guaranteed win if can get the pins right. that works for me.

    Thanks gentlemen

  9. #9
    Senior Member Pensive's Avatar
    Join Date
    Aug 2014
    Location
    Basingstoke, UK
    Posts
    562
    Hi guys

    On the thread subject; I bought this LCD
    http://www.hobbytronics.co.uk/adafru...cs-lcd-rgb-neg

    It states "serial" interface, but doesn't clarify in any further detail anywhere in the technical manual (http://www.ladyada.net/learn/lcd/TG1...%20EN_V1.1.pdf).

    However the 2 serial pins are described as SCLK and SID (which sounds very similiar to i2c pins SCL and SDA) - this is where my uncertainty comes from.

    Since the two basic "serial" pins on the Teensy (0-RX1/1-TX1) make no sense at all in relation to SCLK and SID, I'm a little confuzzled.





    http://pjrc.com/teensy/td_libs_ST7565.html

    On this tutorial pins 5,6,7,8,9 appear to be being used, but 6,7, and 9 are already in use by the audio board on my project.
    I suspect this is "serial" but totally custom,and judging by this code:
    ST7565 glcd(9, 8, 7, 6, 5);
    Can I use any digital pins and just change this pinout in the code, to talk to the alternative pins? Or is it using RX3 and TX3 serial pins (7,8) with the rest as digital outs? If so I'll need to use RX1 and TX1 (pins 0, 1) instead.

    Hope this is clear, I hope you understand my confusion. This kit is a bit of minefield for a newb.

    Cheers

    Jon

  10. #10
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,250
    Looking at it, the term serial just means they send out bits one at a time instead of sending out 8 bits in parallel. It looks like they are doing a software bit-banging, so you should be able to use any digital pins. From the code, it looks like it was originally done as a SPI protocol, but Adafruit changed it to be software bit-banging. I imagine if you do some amount of work, you could re-enable it to use hardware SPI, and it would be faster (though for hardware SPI you need to use the hardware SPI pins).

  11. #11
    Senior Member Pensive's Avatar
    Join Date
    Aug 2014
    Location
    Basingstoke, UK
    Posts
    562
    Thanks Michael, i was beginning to suspect as much. I do not wish to complicate matters unnecessarily.

    I will try it with some of the spare digi pins and see how it works. Guess that's what breadboard is for

  12. #12
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    20,553
    That library works on any 5 pins.

    But for your first attempt, I highly recommend using the exact same 5 pins shown in the example and the photo where you can see it's working.

  13. #13
    Senior Member Pensive's Avatar
    Join Date
    Aug 2014
    Location
    Basingstoke, UK
    Posts
    562
    Understood, Paul. Get it working "on the bench" before I start making changes....

    Wilco.

  14. #14
    Senior Member
    Join Date
    Jun 2013
    Location
    So. Calif
    Posts
    2,828
    serial via a UART is a term that's rather unambiguous.
    A generic term like "serial" should be replaced with UART, I2C, SPI, etc. Some of the authors of product write-ups don't know the difference.
    UART can be emulated in a software serial UART but only used if the hardware UART can't be used for some reason.

    Many kinds of microprocessors have multple UARTs.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •