Shop OBEX P1 Docs P2 Docs Learn Events
Basic idea on new project with serial display — Parallax Forums

Basic idea on new project with serial display

jonwjonw Posts: 67
edited 2012-02-12 16:42 in BASIC Stamp
I saw a project from CalMariner,,and its using a serial 6 digit display with serin command.
I want a display with say 4 to 6 digits ( yes for clock it would be 6 ) but I also want to be able to enter a set time say 10:15,,,even if is not 10;15
Its for show only,,,no practical use
Then i would like to just have the numbers display random numbers,( I suppose i will remove the ds1302 at that point )...can I do this ( Random numbers ) with a serial display?
Q2 would this serial display be easier than using max 7219 for displaying 4 to 6 digits
AND finally if i get that far...i would like to have a keypad.( or any type of digital input )and type a number into the stamp to display ,and then just have the numbers count.

ANY help kindly appreciated,,,jonw Any ideas where to get a serial display,,and any ideas on code ( I have no experience with serial com.) I have built the max 7219 as outlined in scott edwards book Programming and customizing the basic stamp

Comments

  • dandreaedandreae Posts: 1,375
    edited 2011-09-21 08:04
    The StampWorks text book can help you with this project. There are several projects in the text that relate to your project. Here is a link for the free download: http://www.parallax.com/Store/Books/BASICStamp/tabid/168/CategoryID/42/List/0/SortField/0/Level/a/ProductID/144/Default.aspx. Please scroll down to the "Downloads and Resources" section.

    Dave
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2011-09-21 09:15
    jonw wrote:
    Thanks for your reply,chris.
    I plan on posting the questions on how to get started with my idea, as soon as i have enough info.
    I got the idea from CalMariner,,and its using a serial 6 digit display with serin command.
    Q1 would this be easier than using max 7219?
    Q2 Does parallax carry a serial display? If not whats the easiest way to buy one?
    I want a display with say 4 to 6 digits ( yes for clock it would be 6 ) but I also want to be able to enter a set time say 10:15,,,even if is not 10;15
    Its for show only,,,no practical use
    Then i would like to just have the numbers display random numbers,( I suppose i will remove the ds1302 at that point )...can I do this with a serial display?
    AND finally if i get that far...i would like to have a keypad.( or any type of digital input )and type a number into the stamp to display ,and then just have the numbers count
    ANY help kindly appreciated,,,jonw

    jonw,

    As I have already answered this via PM and your message is reworded here, rather than retype the entire reply I will quote your message and paste my reply from the PM.

    Q1 - Yes, serial displays are inherently easier than using the MAX7219 because the display section is already wired. All the segment multiplexing is done for you already.
    Q2 - Parallax carries Serial LCD and a VFD Module. The VFD Module does have a large character mode, but it sounds like you already have the display you want to use anyway.

    If you're just displaying arbitrary numbers then you do not need a DS1302. Similarly if you want those numbers to count up/down you don't need the DS1302 unless you want precision. You could write a loop that counts up/down using a PAUSE 1000 command, but each 'second' would actualy take slightly longer leaving you to try and trim the PAUSE value. If you're not worried about that no problem.

    Adding a keypad can even be done serially. And Parallax stocks a 4x4 keypad that can be multiplexed or read with serial interface chips.
  • jonwjonw Posts: 67
    edited 2011-09-22 16:54
    @ Dandreae I looked at that column ( Infact i looked at each one ) It was some help but I am still at the stage of finding a serial display.
    Does anyone know where I can buy this display ( western usa perfered )

    http://www.velleman.eu/downloads/0/illustrated/illustrated_assembly_manual_k8063.pdf

    under the manuals topic it says ( under serial port connection ) the Data string to let the K8063 know Data is coming in is the command chr$ (13) for byte1.
    Do i put this in my stamp code? Will stamp support this( ie will this display even work with stamp?)
    I posted similiar question in the thread six digits of doom but i need to have my own thread in all fairness to others ( thanks for the understanding). Its easy to overlap sometimes
    Any suggestions on getting a display that will work with serout would be thankful for jonw
  • Mike GreenMike Green Posts: 23,101
    edited 2011-09-22 20:46
    Look at the chapter in the Stamp Manual that explains the SEROUT statement. That explains the format of the SEROUT statement and shows you how to specify 8 data bits at 2400 Baud with 1 stop bit as needed for this display. If the display was connected to I/O pin 5, you'd have a SEROUT statement something like this:

    SEROUT 5, 396, [ 13, 8, "R", 1, 152 ] ' This is taken from page 16 of the display documentation, example 1

    If this doesn't work, you may have to change the 396 to 16780.
  • jonwjonw Posts: 67
    edited 2011-09-25 14:33
    In the manual it says chs$ 13 ,,,,,$ means HEX so if I enter 13 will stamp know i mean hex? Shall i place "R" in the string or the number 82 as per manual pg 16. thanks kindly
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2011-09-26 09:30
    The dollar sign only means HEX when used directly in front of the value, for example, "$13". In this case a 13 or Carriage Return character is to be used.As for the "R", by placing it within quotes it allows the BASIC Stamp to send that letter directly, but as the serial protocol is always sending a byte value it will send the value of "R" which is 82.
  • jonwjonw Posts: 67
    edited 2011-09-26 15:12
    I have the display ordered,and i have a MAX232 CPE, and a stanp BS-2. I was confused on the connection between the max and the stamp.
    When i saw the data sheet on the MAX I assumed i needed to use both pins 10 and 11 , as TTL inputs.
    but now I believe I only need one pin,,,,either max232 PIN 10 or pin11 to connect to the stamp,,,can anyone confirm if this is correct.
  • CalMarinerCalMariner Posts: 64
    edited 2011-10-15 14:45
    Has there been any progress?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2011-10-17 09:31
    Pins 10 and 11 on the MAX232 are the TTL inputs. If you're only sending data to an RS-232 device with no need to receive a response, then you can use one I/O pin on the BASIC Stamp to connect to either pin 10 or 11. You would then connect the output pins (7 and 14, respectively) to the RS-232 device. Is that what you're meaning jonw?
  • jonwjonw Posts: 67
    edited 2012-02-09 09:30
    I am wanting to try the vellman display project again. I have the 7 segment display assembled (and tested).

    I am using 3 wires power,ground,and from display pin#232 , to pin 5 on the stamp. Is this all that is needed, or do I need the 232 interface chip?

    Here is mike greens reply,,,,and i have a question on it.[SEROUT 5, 396, [ 13, 8, "R", 1, 152 ] ' This is taken from page 16 of the display documentation, example 1

    If this doesn't work, you may have to change the 396 to 16780. ]
    what or how do i figure out the last parameter The sum of the previous 4 bytes ie the number 152. ie 2 compilment of the sum of the bytes

    Here is my code ( can someone explain in easier terms how to use [code and / code ] to properly post the code. I will attach it

    I tried 396,and 16780 any help is kindly appreciated. ( I have no experience with serout)
  • jonwjonw Posts: 67
    edited 2012-02-09 17:21
    PS,,to cal mariner thanks for asking on the progress.

    So I will set up the link here for the manual again,,,as the velleman link seems to be down.
    http://www.esr.co.uk/manuals/k8063.pdf

    I will also try installing the rs 232 interface ( just forgot about that part)

    I have two other questions. One,,,when you set the address for the individual digit or display,,,Maybe i miss understood the instructions,,but what i did was , had the jumper installed,and let the display go through its count 1,2,3 etc then i removed the jumper at count 1 ( for address or digit one)...IS This correct,,,or do i need to send the display 'C'
    to change address?

    question 2 to clear up my last posted question ( to help me you will need this manual) is to do with the last number 152 in mike greens example ( which comes from the velleman display document), How do i calculate this,,, the manual says its checksum,,,its the 2 compliment of the sum of the previous 4 bytes)

    Thanks for all replys
  • jonwjonw Posts: 67
    edited 2012-02-10 11:03
    I have the 232 interface chip installed , and here is my code ( directly from the velleman manual pg 16 ) and nothing shows on the display.

    I have used debug and it shows S ( "83" strobe is being sent ) How can i trouble shoot the max 232 chip? Will a scope be use full as i have one?


    DO
    SEROUT 5,396,[13,1,82,1,152]


    SEROUT 5,16780,[13,1,65,48,129]

    PAUSE 100
    SEROUT 5,396,[13,8,83,1,151]
    DEBUG 83
    LOOP
  • jonwjonw Posts: 67
    edited 2012-02-10 20:01
    OK,,The display is starting to work,,,seems like it needed "R" sent to reset.

    I have a O showing on the display now.
    What I would like is for the serout code to count down.
    Can anyone help me with serial code...This is what i have and it does not seem to be working..


    SEROUT 1,396,[13,8,"R",1,152]
    DO

    SEROUT 1,396,[13,1,65,48,129]
    PAUSE 100
    SEROUT 1,396,[13,8,83,1,151]

    SEROUT 1 ,396,[13,8,49,1,128]
    PAUSE 100
    SEROUT 1,396,[13,8,83,1,151]
    LOOP

    With the third byte,,,"R" being reset then 48 ascii 0 then 83 is strobe,,,then i was hoping 49 would display the number ONE ?
    Can I put this whole string in one line ie serout 1,396 [13,1,"R",48,83,49,83,50,83,,,etc to show a count up timer display?
    Also when the sum of the previous 4 bytes are larger than 265,,,i get a negative number and am unsure how to calulate the twos compliment
  • jonwjonw Posts: 67
    edited 2012-02-11 13:53
    This is what I am thinking to display a count from 0,1,2,3, etc But its not working any ideas, where i am going wrong


    DO
    SEROUT 1,396,[13,8,"R",1,152]
    'DO
    'PAUSE 500
    SEROUT 1,396,[13,1,65,48,129]

    PAUSE 100
    SEROUT 1,396,[13,8,83,1,151]

    SEROUT 1 ,396,[13,8,"A",49,128]
    PAUSE 100
    SEROUT 1,396,[13,8,83,1,151]
    SEROUT 1,396,[13,8,"A",50,127]
    SEROUT 1,396,[13,8,83,1,151]
    PAUSE 100

    DEBUG 48
    DEBUG 83
    DEBUG 49
    DEBUG 50
    LOOP
  • jonwjonw Posts: 67
    edited 2012-02-12 16:42
    Ok,,,working now..here is the code for a fake count down timer
    Any help to make it more professional would be greatfull for advice.

    ' This is displaying zero to 9
    DO
    'SEROUT 1,396,[13,8,"R",1,152]

    SEROUT 1,396,[13,1,"A",48,129]
    PAUSE 700
    SEROUT 1,396,[13,8,"S",1,151]
    SEROUT 1,396,[13,1,"A",57,120]
    PAUSE 700
    SEROUT 1,396,[13,8,"S",1,151]
    SEROUT 1,396,[13,1,"A",56,121]
    PAUSE 700
    SEROUT 1,396,[13,8,"S",1,151]
    SEROUT 1,396,[13,1,"A",55,122]
    PAUSE 700
    SEROUT 1,396,[13,8,"S",1,151]
    SEROUT 1,396,[13,1,"A",54,123]
    PAUSE 700
    SEROUT 1,396,[13,8,"S",1,151]
    SEROUT 1,396,[13,1,"A",53,124]
    PAUSE 700
    SEROUT 1,396,[13,8,"S",1,151]
    SEROUT 1,396,[13,1,"A",52,125]
    PAUSE 700
    SEROUT 1,396,[13,8,"S",1,151]
    SEROUT 1,396,[13,1,"A",51,126]
    PAUSE 700
    SEROUT 1,396,[13,8,"S",1,151]
    SEROUT 1,396,[13,1,"A",50,127]
    PAUSE 700
    SEROUT 1,396,[13,8,"S",1,151]
    SEROUT 1,396,[13,1,"A",49,128]
    PAUSE 700
    SEROUT 1,396,[13,8,"S",1,151]
    LOOP
Sign In or Register to comment.