Shop Learn
Changing the baud rate for a 7 segment display — Parallax Forums

Changing the baud rate for a 7 segment display

Hello! I'm using the BS1 (yes I'm going cheap!) to display something on a 7 segment display by Sparkfun.
By default the display's baud rate is set to 9600bps and I need to change it to 2400 to work with BS1.
The documentation says:
This can be configured using the baud rate configuration command: 0x7F. This command should be followed by a single data byte (0 for 2400) . How do I send that from the BS1 ??????
Follow the link, scroll down to "Baud Rate Configuration":
https://github.com/sparkfun/Serial7SegmentDisplay/wiki/Special-Commands#baud

I know is a simple line so please help me!!!!! Thanks!

Comments

  • JonnyMacJonnyMac Posts: 7,706
    edited 2021-09-09 23:14

    Unfortunaely, 2400 baud is the top baud rate for the BS1. Is the baud change nonvolatile? If it is, you could set it with another device and then connect to the BS1.

  • Hey Johnny:
    2400 baud rate is fine. The BS1 works at that rate and the display also works at 2400 baud.
    But like a said on my post. The baud rate on the display needs to be set. I don’t know how to do that.
    Is just a line of code that needs to be sent from the BS1 to the display> @JonnyMac said:

    Unfortunaely, 2400 baud is the top baud rate for the BS1. Is the baud change nonvolatile? If it is, you could set it with another device and then connect to the BS1.

    @JonnyMac said:
    Unfortunaely, 2400 baud is the top baud rate for the BS1. Is the baud change nonvolatile? If it is, you could set it with another device and then connect to the BS1.

  • JonnyMacJonnyMac Posts: 7,706
    edited 2021-09-10 00:05

    Is just a line of code that needs to be sent from the BS1 to the display

    Not to change the baud rate from 9600 to 2400, it's not.

    1) Please don't call me Johnny (see my signature). My name is Jon.
    2) I've been programming the BS1 since 1994.
    3) I know what I'm doing when it comes to the BS1 (1000+ programs, including for big companies like Disneyland -- yes, they use BS1s in the park).
    4) Unless you have one of those boards that Scott Edwards made with two crystals, you cannot get the BS1 to send serial at 9600 baud.
    5) Your display is preset to 9600 baud, which means you need a processor that can do 9600 to set your display to 2400 so that it will work with a standard BS1.

  • Hey Jon,
    Thanks for the info. Can I use the BS2 to change the rate of the display permanently? Then use the BS1 with the display working in 2400.
    How can I do that with the BS2 ?
    Can you help me?

    @JonnyMac said:

    Is just a line of code that needs to be sent from the BS1 to the display

    Not to change the baud rate from 9600 to 2400, it's not.

    1) Please don't call me Johnny (see my signature). My name is Jon.
    2) I've been programming the BS1 since 1994.
    3) I know what I'm doing when it comes to the BS1 (1000+ programs, including for big companies like Disneyland -- yes, they use BS1s in the park).
    4) Unless you have one of those boards that Scott Edwards made with two crystals, you cannot get the BS1 to send serial at 9600 baud.
    5) Your display is preset to 9600 baud, which means you need a processor that can do 9600 to set your display to 2400 so that it will work with a standard BS1.

  • JonnyMacJonnyMac Posts: 7,706

    I cannot guarantee this will work. I simply did -- _what you should have _-- and consulted the Sparkfun docs for that device. That said, I don't have one of those on my desk, so I cannot test beyond a basic syntax check of the BS2 code.

    JonnyMac out.

  • Thanks Jon! I will try that!

    Luis

    @JonnyMac said:

    Is just a line of code that needs to be sent from the BS1 to the display

    Not to change the baud rate from 9600 to 2400, it's not.

    1) Please don't call me Johnny (see my signature). My name is Jon.
    2) I've been programming the BS1 since 1994.
    3) I know what I'm doing when it comes to the BS1 (1000+ programs, including for big companies like Disneyland -- yes, they use BS1s in the park).
    4) Unless you have one of those boards that Scott Edwards made with two crystals, you cannot get the BS1 to send serial at 9600 baud.
    5) Your display is preset to 9600 baud, which means you need a processor that can do 9600 to set your display to 2400 so that it will work with a standard BS1.

  • Luis_PLuis_P Posts: 131
    edited 2021-09-10 20:05

    @Luis_P said:
    Thanks Jon! I will try that!

    Luis

    @JonnyMac said:

    Is just a line of code that needs to be sent from the BS1 to the display

    Not to change the baud rate from 9600 to 2400, it's not.

    1) Please don't call me Johnny (see my signature). My name is Jon.
    2) I've been programming the BS1 since 1994.
    3) I know what I'm doing when it comes to the BS1 (1000+ programs, including for big companies like Disneyland -- yes, they use BS1s in the park).
    4) Unless you have one of those boards that Scott Edwards made with two crystals, you cannot get the BS1 to send serial at 9600 baud.
    5) Your display is preset to 9600 baud, which means you need a processor that can do 9600 to set your display to 2400 so that it will work with a standard BS1.

    Hi Jon,
    After restarting the display now the BS1 is communicating with the display!
    But i don't know how to write something on the display. Binary? hex? How do I write 'Done" with BS1 ????
    SEROUT 1, Baud, (???????)

  • @Luis_P said:

    Hey Jon,
    Thanks for the info. Can I use the BS2 to change the rate of the display permanently? Then use the BS1 with the display working in 2400.
    How can I do that with the BS2 ?
    Can you help me?

    @JonnyMac said:

    Is just a line of code that needs to be sent from the BS1 to the display

    Not to change the baud rate from 9600 to 2400, it's not.

    1) Please don't call me Johnny (see my signature). My name is Jon.
    2) I've been programming the BS1 since 1994.
    3) I know what I'm doing when it comes to the BS1 (1000+ programs, including for big companies like Disneyland -- yes, they use BS1s in the park).
    4) Unless you have one of those boards that Scott Edwards made with two crystals, you cannot get the BS1 to send serial at 9600 baud.
    5) Your display is preset to 9600 baud, which means you need a processor that can do 9600 to set your display to 2400 so that it will work with a standard BS1.

    Hi Jon,
    After restarting the display now the BS1 is communicating with the display!
    But i don't know how to write something on the display. Binary? hex? How do I write 'Done" with BS1 ????
    SEROUT 1, Baud, (???????)

  • JonnyMacJonnyMac Posts: 7,706
    edited 2021-09-11 02:20

    You know... at some point you're going to have to crack open a manual or help file. As I helped with the BASIC Stamp manual examples way back when, I know it shows how to do SEROUT, and the baud rate parameters for the BS1 are built into the language (you want T2400). Sparkfun provides documentation on their site for the various commands used by that module. Have you read that?

    Final hint: For simple SEROUT, the only difference between the BS1 and BS2 is the use of () versus [].

    SEROUT on the BS1:

      SEROUT TX, T2400, ($76)                       ' clear display
      SEROUT TX, T2400, ($7B, %00111000)            ' L
      SEROUT TX, T2400, ($7C, %01110111)            ' A
      SEROUT TX, T2400, ($7D, %01011011)            ' Z
      SEROUT TX, T2400, ($7E, %01101110)            ' Y
    
  • Luis_PLuis_P Posts: 131
    edited 2021-09-11 15:18

    @JonnyMac said:
    You know... at some point you're going to have to crack open a manual or help file. As I helped with the BASIC Stamp manual examples way back when, I know it shows how to do SEROUT, and the baud rate parameters for the BS1 are built into the language (you want T2400). Sparkfun provides documentation on their site for the various commands used by that module. Have you read that?

    Final hint: For simple SEROUT, the only difference between the BS1 and BS2 is the use of () versus [].

    SEROUT on the BS1:

      SEROUT TX, T2400, ($76)                       ' clear display
      SEROUT TX, T2400, ($7B, %00111000)            ' L
      SEROUT TX, T2400, ($7C, %01110111)            ' A
      SEROUT TX, T2400, ($7D, %01011011)            ' Z
      SEROUT TX, T2400, ($7E, %01101110)            ' Y
    

    JON (NOT JONNY).
    Everything is working now. I was doing it right but I was declaring the baud rate like this: SYMBOL Baud = N2400
    and for some reason does not work like that. Using T2400.
    Where did you get %00111000 = L and so on?? is there a table in somewhere? or what type of conversion?
    Thanks
    Luis

  • JonnyMacJonnyMac Posts: 7,706
    edited 2021-09-11 16:04

    I'm glad that you got it working and enjoyed the joke. To be fair, I didn't think you'd written any code because you didn't post any here.

    I'm not sure why you went with N2400 -- other than perhaps not understanding serial modes. Standard serial -- like you need here -- is called True mode (Txxxx in BS1). The idle state of the line is high, with a low-going start bit. Data bits are at the normal level (0 bit is low, 1 bit is high). Inverted mode (Nxxxx in BS1) flips those signals; the idle state is low, the start bit is high, and the data bits are the opposite of their value (0 is high, 1 is low). Why do this? Back in the old days when we had RS-232 serial ports on our PCs, the signals coming out of them were inverted. Inverted mode let us interface directly to an RS-232 port with nothing more than a resistor to protect the RX pin. This is from the BASIC Stamp help file:

    You won't use inverted mode anymore unless you have a really old PC, or are connecting to a device designed to connect to a standard RS-232 port (like the Scott Edwards LCDS).

    Thanks for your help and sending us your resume...

    You're welcome. I am available for hire! :)

    And if you want to know more of my Parallax processor programming philosophy, check out my articles in Nuts & Volts (BS1, BS2, SX, P1, and P2), and my book StampWorks (my name used to be Jon Williams).

  • @JonnyMac said:
    I'm glad that you got it working and enjoyed the joke. To be fair, I didn't think you'd written any code because you didn't post any here.

    I'm not sure why you went with N2400 -- other than perhaps not understanding serial modes. Standard serial -- like you need here -- is called True mode (Txxxx in BS1). The idle state of the line is high, with a low-going start bit. Data bits are at the normal level (0 bit is low, 1 bit is high). Inverted mode (Nxxxx in BS1) flips those signals; the idle state is low, the start bit is high, and the data bits are the opposite of their value (0 is high, 1 is low). Why do this? Back in the old days when we had RS-232 serial ports on our PCs, the signals coming out of them were inverted. Inverted mode let us interface directly to an RS-232 port with nothing more than a resistor to protect the RX pin. This is from the BASIC Stamp help file:

    You won't use inverted mode anymore unless you have a really old PC, or are connecting to a device designed to connect to a standard RS-232 port (like the Scott Edwards LCDS).

    Thanks for your help and sending us your resume...

    You're welcome. I am available for hire! :)

    And if you want to know more of my Parallax processor programming philosophy, check out my articles in Nuts & Volts (BS1, BS2, SX, P1, and P2), and my book StampWorks (my name used to be Jon Williams).

    Jon where I can find info about writing the letters or numbers is binary? Is there a table somewhere?

  • The answer is to look "up" in the first post original data sheet you posted regarding setting the baud.... look up from there in the data sheet to the "Individual Segment Control" section...

    SEROUT TX, T2400, ($76) ' clear display
    SEROUT TX, T2400, ($7B, %01010000) ' R
    SEROUT TX, T2400, ($7C, %01111001) ' E
    SEROUT TX, T2400, ($7D, %01110111) ' A
    SEROUT TX, T2400, ($7E, %01011110) ' D

  • JonnyMacJonnyMac Posts: 7,706
    edited 2021-09-11 19:08

    [Removed by JM -- I answered the wrong question]

  • JonnyMacJonnyMac Posts: 7,706
    edited 2021-09-11 19:08

    [Removed by JM]

  • @"Beau Schwabe" said:
    The answer is to look "up" in the first post original data sheet you posted regarding setting the baud.... look up from there in the data sheet to the "Individual Segment Control" section...

    SEROUT TX, T2400, ($76) ' clear display
    SEROUT TX, T2400, ($7B, %01010000) ' R
    SEROUT TX, T2400, ($7C, %01111001) ' E
    SEROUT TX, T2400, ($7D, %01110111) ' A
    SEROUT TX, T2400, ($7E, %01011110) ' D

    Hi Jon. I have read everywhere and I can't find a section that says A = 01110111
    I don't understand how! all it shows is hex values 0x01 = 1 I don't see a section ""Individual Segment Control" also not found.
    Can you tell me how this works? and you can sleep peaceful .... :)

  • fridafrida Posts: 148

    Via the link you have in post 1, you will find this link.

    https://github.com/sparkfun/Serial7SegmentDisplay/wiki/Special-Commands
    

    I think that's what you need.

  • @frida said:
    Via the link you have in post 1, you will find this link.

    https://github.com/sparkfun/Serial7SegmentDisplay/wiki/Special-Commands
    

    I think that's what you need.

    It does not say nowhere R=%01010000 E= %01111001 A = %01110111 D=%01011110
    I don get the logic.
    How Jon McPhalen is doing it? I tried convert HEX to binary but is not that.

  • I think this is the answer?

  • Any ideas why using the BS1 (2400 baud rate) the 7 segment display is not as consistent but the BS2 (9600bps) is.
    Sometimes displays the right thing and sometimes displays random symbols... It has to do something with the speed????
    with this code I'm sending 0001 to the display and I get this (see picture)

    SEROUT 1, T2400, ($76, %00000000) 'clear display
    SEROUT 1, T2400, ($7B, %00000000) 'nothing
    SEROUT 1, T2400, ($7C, %00000000) 'nothing
    SEROUT 1, T2400, ($7D, %00000000) 'nothing
    SEROUT 1, T2400, ($7E, %00110000) ' 1

  • Luis_PLuis_P Posts: 131
    edited 2021-09-12 20:14

    OK I think I figure what was the problem.
    To clear up the display for some reason you have to send:

    SEROUT 1, T2400, ($76, %00000000)

    Otherwise the other command lines act funny.... :)

Sign In or Register to comment.