Serial display driving problems [RESOLVED]

Hi guys,

I'm having a bit of bother trying to get a particular display module working. Here's what I've got:

I want to use the display in asynchronous serial mode but instead of sending characters to it from a serial monitor on the PC, I want the Arduino (I'm using the UNO board) to do it instead. There's a PIC on-board which is supposed to take the data and do all the heavy lifting for driving the displays, but the data sheet is not very helpful for my chosen application, and being a massive n00b, looking through the source code has left me none-the-wiser as I'm not entirely sure what I'm looking for.

I've checked and double-checked the handful of jumper wires needed and I'm pretty sure I've not done anything stupid like having the Tx/Rx pins the wrong way around.

Any guidelines or helpful hints would be appreciated, it's a very attractive display and I'd like to be able to get some use out of it :-))

Cheers!

I want to use the display in asynchronous serial mode but instead of sending characters to it from a serial monitor on the PC, I want the Arduino (I'm using the UNO board) to do it instead.

I would start out by doing the first part, sending characters to it from a serial monitor on the PC. This will verify the required wiring and the required communications parameters. It should then be relatively straightforward to switch those connections to the Arduino and duplicate the communications parameters in your sketch.

What have you done so far?

Don

I second Don's suggestion to get the display to work on a PC first(over a TTL serial USB adapter). I don't know if you read page 5 where it says you need to use 115,200 baud rate and once you connect to it, it sends you a bunch of message. You can use that message to determine if the connection is made. Also on the same page, it says you should pluu BL to ground even if you are using serial. Did you do that?

Thanks for the replies so far!

Unfortunately I don't own a TTL/USB converter, although it is on my shopping list. Is there any way I can modify an Uno board to accomplish the same thing? Like pulling the MCU out so the 8U2 HAS to talk to whatever I've wired up to the Tx/Tx pin headers?

I did remember about the blanking pin :-)) I've got the display to light all segments using synchronous mode so I'm fairly confident the hardware actually works, and the fault lies with me.

BulletMagnet83:
Thanks for the replies so far!

Unfortunately I don't own a TTL/USB converter, although it is on my shopping list. Is there any way I can modify an Uno board to accomplish the same thing? Like pulling the MCU out so the 8U2 HAS to talk to whatever I've wired up to the Tx/Tx pin headers?

I did remember about the blanking pin :-)) I've got the display to light all segments using synchronous mode so I'm fairly confident the hardware actually works, and the fault lies with me.

If you remove the MCU from arduino and connect TX to TX and RX to RX, you will be using the 8U2 (or 16U2) TTL USB adapter on the UNO board to connect to PC.

Excellent!

I have made some progress on this tonight, and while I would still love to use the asynchronous mode purely for the satisfaction of knowing how, I've got the damn thing to behave itself and display some characters.

Tackling the problem again with a fresh head, and a can of calm-down juice, I re-read the shiftOut tutorials and figured out what I've been doing wrong. So, using the board like a giant shift register, I made it do this:

Which is a huge step forward from what it was doing before (either nothing, or garbage :stuck_out_tongue: )

I'll try my best not to beg to be spoon-fed without fiddling around on my own for a bit first, but I'll probably run into more problems before too long!

Good job! Was the fast forward after 'L' intentional? :wink:

liudr:
Good job! Was the fast forward after 'L' intentional? :wink:

Actually it was :wink: I ran out of time in the evening for messing around working out hex values for characters, so I just did a blank-and-loop! I'm getting my groove on with it now though, so I should be able to do the rest fairly quickly. I'm thinking about a metric crapload of #define statements in a header file or something so whatever program I end up writing doesn't end up stupidly long...

Have you thought about any particular project with this display?

Yeah, I want to use it as part of a new timer project... I've got the 4-digit 7-segment version down and it's pretty much ready for the final build, but I thought I could build something much more visually impressive using this, as I've always had a "thing" for retro-looking displays rather than LCDs.

The thing I'm stuck on now, if I continue to use the display in this mode, is how to get from the values generated by the timer program (e.g. tens of minutes, ones of minutes, tens of seconds, etc...) to characters on the display.

I've got the thing to talk to my PC over a serial terminal connection, and after fiddling with some settings I've got it to display any string I want :smiley: So I think that's the way I want to go... if possible, using the serialprint function to just send human-readable values straight over rather than messy look-up tables.

Provide us your code in a different thread and we will help.

Ok, thanks! I'll try to get something thrown together over the weekend. I think I know the sort of statements I need to be using, just not exactly how to use them! If I'm still stuck after going at it for a few hours I'll post a new thread in the relevant sub-forum :-))

Hey all, just thought I'd post a little update. I've put some hours in today fiddling around with code, and I think I've pretty much cracked using the display. Taught myself how to use arrays which has made things a LOT neater, and made my plans to use the hardware serial port on the arduino completely unnecessary. I also managed to sort out a problem which made the display print nothing but crap on power-up/reset most of the time by throwing in a short delay before the program starts properly. Seems to work fine now.

Thanks for bearing with me while I've thrown ideas around, it's been very helpful just having an outlet to type it all out! :slight_smile:

Here's a short and crappy video of my progress so far:

Cool! Did you use a buzzer for the sound effect?

Yeah! For any timer project, you've gotta have the beeps and bloops. Especially if it's destined to be used for war games for that "movie prop" feel.

Here's what I've got going on code-wise at the moment:

const int SDATA = 12;            //pin definitions, treating the DSP-0801 like a giant shift register
const int CLOCK = 11;
const int LATCH = 10;

int t_minutes = 0;               //set up timekeeping variables, available to all functions (not used yet!)
int u_minutes = 0;
int t_seconds = 0;
int u_seconds = 0;

void setup () {
  
  pinMode(SDATA, OUTPUT);    //set those pins to output
  pinMode(CLOCK, OUTPUT);
  pinMode(LATCH, OUTPUT);
  
  
  delay(500);                                   //allow DSP-0801's onboard PIC to wake up before sending anything, seems to fix display bugs MOST of the time
  
  for(int i = 0; i < 8; i++) {                  //send 8 blank digits to clear all registers
    digitalWrite(LATCH, LOW);
    shiftOut(SDATA, CLOCK, MSBFIRST, 0x0000);   //send this value twice in 8-bit sections
    shiftOut(SDATA, CLOCK, MSBFIRST, 0x0000);
    digitalWrite(LATCH, HIGH);
  }
  
   
  int scrollRate   = 100;                                                 //defines how fast digits will scroll
  word charTable[8] = {
    0x00F7, 0x8F3, 0x1536, 0x0079, 0x120F, 0x4000, 0x4000, 0x4000 };      //character table array - what we want to put on the display goes in here
  
 
  for(int index = 0; index < 8; index++){
  word charData = charTable[index];
  
  digitalWrite(LATCH, LOW);
  shiftOut(SDATA, CLOCK, MSBFIRST, (charData >> 8));    //send high byte
  shiftOut(SDATA, CLOCK, MSBFIRST, charData);           //send low byte
  digitalWrite(LATCH, HIGH);
  delay(scrollRate);
  tone(7, 700, 10);
  
}

 tone(7, 1400, 50);
 delay(250);
 
}

 





void loop () {
  
   int scrollRate   = 100;
   word charTable[8] = {
    0x120F, 0x0038, 0x1500, 0x0000, 0x243F, 0x643F, 0x243F, 0x243F };
  
 
  for(int index = 0; index < 8; index++){
  word charData = charTable[index];
  
  digitalWrite(LATCH, LOW);
  shiftOut(SDATA, CLOCK, MSBFIRST, (charData >> 8));
  shiftOut(SDATA, CLOCK, MSBFIRST, charData);
  digitalWrite(LATCH, HIGH);
  
  }
  
  while(1) {
  }
  
  
}