Announcement

Collapse
No announcement yet.

Connection between BASIC Stamp and LCD-32PT

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

  • lmoliver
    replied


    Sorry...
    I have had a problem of overheat with the LCD-32PT (I think this hasn't solution :-(
    and at this moment I am testing with uVGA-II module.
    I have already found the correct code for BASIC Stamp:At the beginning of the code it must have the following thing...
    '*********************
    'Código condicional
    '*********************
    #SELECT $STAMP 'PULSOUT Scaling
    #CASE BS2
    POScale CON $0100
    #CASE BS2P
    POScale CON $0280
    #ENDSELECT

    #SELECT $STAMP 'PULSIN Scaling
    #CASE BS2
    PIScale CON $0100
    #CASE BS2P
    PIScale CON $0280
    #ENDSELECT

    #SELECT $STAMP 'FREQOUT Duration Scaling
    #CASE BS2
    FODScale CON $0100
    #CASE BS2P
    FODScale CON $03C6
    #ENDSELECT

    #SELECT $STAMP 'FREQOUT Freq Scaling
    #CASE BS2
    FOFScale CON $0100
    #CASE BS2P
    FOFScale CON $0044
    #ENDSELECT

    #SELECT $STAMP 'Baud Rates
    #CASE BS2
    T1200 CON 813
    T2400 CON 396
    T4800 CON 188
    T9600 CON 84
    T19K2 CON 32
    T38K4 CON 6
    #CASE BS2P
    T1200 CON 2063
    T2400 CON 1021
    T4800 CON 500
    T9600 CON 240
    T19K2 CON 110
    T38K4 CON 45
    #ENDSELECT

    the commando serin must take this form (p.e. showing the value of temperature)...
    SEROUT 15, T9600, ["s", 1, 1, 2, $FF, $E0, Temperatura: ,, $00]
    GOSUB GetACK
    SEROUT 15, T9600, [s, 16, 1, 2, $FF, $FF, DEC temp/16, $00]
    GOSUB GetACK
    SEROUT 15, T9600, [s, 19, 1, 2, $FF, $FF, DEC2 tempdec, $00]
    GOSUB GetACK

    and in order to verify the NACK...
    '************************
    'Comprueba respuesta
    '************************
    GetACK:
    SERIN 14, T9600, 300, Missed, [tmp]
    IF (tmp = $06) THEN
    DEBUG "ACK --> ", HEX tmp,CR
    ELSE
    DEBUG "NACK! --> ", HEX tmp, CR
    ENDIF
    RETURN

    Missed:
    DEBUG "Missed --> ", HEX tmp, CR
    RETURN

    For support in Spanish
    , I explain in http://www.aprenderobotica.com/group/displays4dsystems the details of the code and contribute several examples to work with microcontroller BASIC Stamp
    .

    Thanks!

    Leave a comment:


  • lmoliver
    replied


    It is possible that the problem is in which comments in this post:
    http://forums.parallax.com/showthread.php?99215-uLED-128-GMD1&p=692322&viewfull=1#post692322
    ... adding 10k resistors from data lines to Vdd?

    Somebody can confirm it to me?
    Thanks!

    Lorenzo

    Leave a comment:


  • lmoliver
    replied


    According to which you stays commenting, I have been trying with any changes...

    GetACK:
    SERIN 3, T9600, [Rx]
    DEBUG "ACK --> ", Rx
    ...
    ...

    GetACK:
    PAUSE 2500 'PAUSE 100, PAUSE 500, PAUSE 1000, PAUSE 2000,...
    SERIN 3, T9600, [Rx]
    DEBUG "ACK --> ", Rx
    ...
    ...

    GetACK:
    SERIN 3, T9600, [Rx]
    PAUSE 2500 'PAUSE 100, PAUSE 500, PAUSE 1000, PAUSE 2000,...
    DEBUG "ACK --> ", Rx
    ...
    ...

    GetACK:
    SERIN 3, T9600, [Rx]
    ...
    ...

    but it continues with the same results.

    I think that there isn't data reception in the BASIC Stamp; therefore, I am going to review the specifications of SERIN in the BASIC Stamp. Between BASIC Stamps certainly the interchange RX and TX works correctly; I do not understand what can be happening. Next, I will comment here the results of my other verifications.

    With respect to the subject of speaker, I am going to contact with 4D Systems.

    Thanks!
    We follow in contact...
    Lorenzo

    Leave a comment:


  • Schwahn
    replied


    Sorry, I am not sure why the speaker would be getting so warm. You will need to see if someone from 4D Systems can help you; the only thing I can think of is that the coupling capacitor (if there is one) my be shorted which is allowing a small DC voltage to heat the coil up in the speaker.
    I have encountered MANY timing issues with my Basicmicro NANO; I was going to try my BS2 to see if the timing issues would be resolved but it appears based on your experience that this is not the case.
    Keep me informed of your progress if you have time. This week I'll fire up my old BS2 board and see if I have any better luck (if nothing else we can exchange code examples).
    Thanks-Brian

    Leave a comment:


  • Atilla
    replied


    I'm not sure how fast the Stamp is but by the time you jump to the GetACK subroutine and print DEBUG "-> GetACK", CR you may already be missing the ACK from the display. I'm not familiar with the STAMP but you might try looking for the ACK first and then printing with DEBUG:
    '****************
    GetACK:
    SERIN 3, T9600, [Rx]
    DEBUG "-> GetACK", CR
    ......

    Leave a comment:


  • lmoliver
    replied


    Thaks, Atilla & Schwahn,Indeed, I committed an error with the speed... It's already OK.

    This weekend I have been reading the documentation and realising several tests: The tests that I realise from Workshop work more or less well, but in way SGC, from BASIC STAMP, no. It seems that the problem is when checking for ACK
    ; in this step, the program is stopped or is expected...

    This is pBASIC code for the BASIC Stamp:

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    '
    Rx VAR Byte

    #SELECT $STAMP 'Baud Rates
    #CASE BS2
    T1200 CON 813
    T2400 CON 396
    T4800 CON 188
    T9600 CON 84
    T19K2 CON 32
    T38K4 CON 6
    #CASE BS2P
    T1200 CON 2063
    T2400 CON 1021
    T4800 CON 500
    T9600 CON 240
    T19K2 CON 110
    T38K4 CON 45
    #ENDSELECT

    '***************************
    DEBUG "Iniciando... ", CR
    PAUSE 1500

    Main:
    DEBUG "-> Establish auto-baud", CR
    SEROUT 2, T9600, [$55]
    GOSUB GetACK
    PAUSE 100
    SEROUT 2, T9600, ["s", 1, 8, 3, $FF, $E0, texto amarillo, $00]
    GOSUB GetACK
    STOP

    '****************
    GetACK:
    DEBUG "-> GetACK", CR
    SERIN 3, T9600, [Rx]
    DEBUG "ACK --> ", Rx
    IF (Rx = $06) THEN
    RETURN
    ELSE
    DEBUG "NAK ", HEX Rx, CR
    DEBUG "Power it down!", CR
    SEROUT 2, T9600, [$59, $03, $00]
    ENDIF
    RETURN

    Note: When I eliminate all calls to subroutine (GOSUB GetACK), finally I can see the test in the screen (I know that this is'nt the correct :-)

    With respect to the other problem, microspeaker warms up too much (very hot). Just in case, I can disconnect it of the board? I do not need it...

    Thanks for your help. I am trying to know the product to help the Hispanic community.
    Attached files

    Leave a comment:


  • Schwahn
    replied


    Greetings again,Whenever you send a command you must wait for a ACK back (as you said time to study the documents).
    The concept with the 4D SGC systems is
    1) Send command2) Wait/check for ACK3) Continue with program
    Here is some sample code that should be fairly easy to reverse-engineer back for a BS2 (this is from my touch screen code that I could not get to work; you can search for schwahn and find the entire code listing if you wish other basic commands):
    RST CON 2
    W VAR WORDX VAR WORDY VAR WORD
    TSTATUS VAR WORDXLSB VAR BYTEXMSB VAR BYTEYLSB VAR BYTEfont-family: Verdana; font-size: 11px; ">YMSB VAR BYTE
    CLEAR
    DEBUG [0]LCDSTAT VAR WORDLOW RSTPAUSE 500HIGH RSTPAUSE 1000
    DEBUG [Sending Auto-Baud Command,13]SETHSERIAL1 H9600HSEROUT [$55]GOSUB ACK
    DEBUG [Turn on touch screen,13]HSEROUT [$59,$05,$00]GOSUB ACK
    erdana; font-size: 11px; ">DEBUG [Reset touch screen,13]HSEROUT [$59,$05,$02]GOSUB ACK
    END
    ACK HSERIN [LCDSTAT] IF LCDSTAT=$15 THEN DEBUG [Command Error:,HEX LCDSTAT,13] ENDIF IF LCDSTAT=$06 THEN DEBUG [Command OK:,HEX LCDSTAT,13]e="Arial"> ELSE DEBUG [Command returned: ,HEX LCDSTAT,13] ENDIF RETURN

    Leave a comment:


  • Atilla
    replied


    1) You need to send the autobaud command ($55) at 9600 baud.
    2) No the speaker should not be getting hot, even if it's playing audio.

    Leave a comment:


  • lmoliver
    replied


    Oh, no...
    I see 2 problems: 1- I am using the following program code for my BASIC Stamp2, but I do not see any change in el uLCD-32PT; only I see the default screen with the name of the screen model:

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}

    PAUSE 1000
    SEROUT 2, 240,[$55]
    PAUSE 1000
    SEROUT 2, 240, ["s", 3, 1, 0, $FF, $E0, Esto es una prueba, $00]

    I already know that it is a first very basic step, but although I have read the documentation, I do not know if I am forgetting some essential step so that I can see the first tests in the display.


    2-
    The micro loudspeaker is overheated much to the 5 minutes of operation. It is normal?

    I attach a image...

    Attached files

    Leave a comment:


  • Atilla
    replied


    Happy to help

    Leave a comment:


  • lmoliver
    replied


    Thank you for all your help!
    Indeed, I have seen a wiring general scheme with Host and I do not see additional components.

    Thank you very much again!
    Greetings from Spain!


    (I sorry, my English is very bad :-P )

    Leave a comment:


  • Atilla
    replied


    For any PICASO display module, all the Input pins are 5V tolerant.

    Leave a comment:


  • Schwahn
    replied


    Greetings,
    I use the Basicmicro NANO (cheap version of the BS2) and I have not used any current limiting resistors; seems to work fine (touch screen is another story). Let's get the official word from 4D support (I think in the docs for the display they do show a basic schematic for connection to a CPU).
    thx-Brian

    Leave a comment:


  • 4dTechSupport
    replied


    All our modules have series limiting resistors of 68 ohms for RX/TX/RESET and RX input has 10K pull-up resistor so you can connect the Rx/Tx line of the host directly to the display module as long as the host communicates at TTL signal levels through Rx/Tx.

    Note: uLCD-32PT(SGC) is based on PICASO-SGC processor which accepts Autobaud command at 9600Baud only.
    -Bilal

    Leave a comment:


  • lmoliver
    started a topic Connection between BASIC Stamp and LCD-32PT

    Connection between BASIC Stamp and LCD-32PT

    Hello guys,
    I have not seen any wiring scheme between BASIC Stamp (BS2) and a LCD-32PT (SGC). It is necessary to place a resistance of protection between the pin of BS and the one of the LCD-32PT?
    Thanks!
Working...
X