Atmega168 Serial Speed

Interfacing hardware, sensors, output drivers, chips.
mlctrez
Posts: 4
Joined: Mon Jun 23, 2008 4:03 pm

Atmega168 Serial Speed

Post by mlctrez »

I've recently happened upon a surplus Trans-Lux 4x16 by 5x7 dot matrix display board:
http://picasaweb.google.com/mlctrez/TransLuxDisplay

This is probably one that is used to build one of the DataWall products:
http://www.trans-lux.com/ind_text.htm

I would like to drive this beast using an ATmega168 but I am questioning if I need more horsepower. :!:
From my calculations, 32 5x7 displays ( 1 clock/data pair per two rows) * 10 bits (dual color) per display * 7 rows per display = 2240 bits @ ~45 times a second to reduce visible flicker.
This works out ( if my math is correct ) to under 115Kbps but there also needs to be some time spent with the bits being displayed. i.e. push out 2240 bits, enable a row for a while, then move on to the next row.
I don't know what this duty cycle should be, but even if it is only 50%, I think this puts the data rate somewhere in the 200Kbps range.

What is the maximum data rate that can be sent out on an digital pin on an Atmega168? Is it limited just by the controller clock speed and the code responsible for pushing the data out the pin, or is there something else that is the limiting factor?

Thanks in advance,
Matt

oz
Site Admin
Posts: 542
Joined: Mon May 12, 2008 4:19 pm

Re: Atmega168 Serial Speed

Post by oz »

Matt,

Sorry for the very tardy reply - I'm still getting used to my own forum software. I didn't parse out all your math - not quite getting the data format and color, but if your calculations are correct I actually think that it will work - also if you've got your bases covered on other aspects of the device, but there usually isn't too much to synchronous serial. You shouldn't confuse synchronous serial (shiftout) with asynchronous serial (serial .print et al) Synchronous serial operates as fast as the microcontroller operations can pump the data out, which could easily be 200 - 500khz if the data retrieval operation isn't too painful

Ask yourself whether you are going to have enough storage on the 168 to do what you want to do though - on that front I think I'd look for a larger uC chip. How about the Wiring board (Atmega128)?

Using the 1`68 though there are some things you can do to achieve significant speedups. You could avoid the Arduino shiftout call and do some register-level bit banging of the shiftout command, it's really pretty simple if you look at the code, using a register call instead of digitalWrite speeds things up by a factor of 8 to 10 depending on what else is happening of course. Secondly, you could dig into the datasheet and look at the SPI interface, which is dedicated hardware, and really fast.

Good luck with it and post again if you think I can help.

Paul

mlctrez
Posts: 4
Joined: Mon Jun 23, 2008 4:03 pm

Re: Atmega168 Serial Speed

Post by mlctrez »

Paul -

http://picasaweb.google.com/mlctrez/Tra ... 0232134530

Thanks for the tips. I was able to squeeze enough speed out by writing to the registers directly. Now I just need to see if I can drive the other half too !!

Thanks again,
Matt

winfieldmike
Posts: 1
Joined: Fri Apr 24, 2009 3:17 pm

Re: Atmega168 Serial Speed

Post by winfieldmike »

Hi Matt,

I have also stumbled upon one of the exact same boards you have. I am unable to find any data for the pinouts/power etc.

We are hoping to incorporate this display into a robot for an expo in May.

Would you be so kind as to share the pinouts?

Thanks a million!

Mike

mlctrez
Posts: 4
Joined: Mon Jun 23, 2008 4:03 pm

Re: Atmega168 Serial Speed

Post by mlctrez »

Mike -

I've uploaded a schematic I created for the power board to picasaweb. Several hours with a continuity meter! This is a scan of a jpg of an eagle schematic I created to help me understand how to get the display working. If I find the original eagle files, I'll try to post them or at least a better picture.
http://picasaweb.google.com/mlctrez/Tra ... 7879061234

The larger connections on the back of the power board are for +5, +12, GND, VLED, and AGND.
The silkscreen side shows the pin outs: http://picasaweb.google.com/mlctrez/Tra ... 7416531890

Not knowing the correct VLED voltage, I used +12 from the ATX power supply. It seems to work fine. The rest of the power connections were wired to the appropriate voltages from the ATX supply, with AGND connected to GND.

Now, to drive the display.. The J2 and J4 din connectors are input and output respectively. From the schematic, J2 pins 1,3 and 5 are clock, data, and enable for the top two rows of the display and 10,8 and 6 are for the bottom two rows. ( I think the schematic has pins 5 and 6 incorrect ) I have not used J4 yet, but from what I can tell, these displays can be chained together as wide as needed.

The clock and data lines are used to shift data into the display. The first ( 32 (displays) * 2 (colors) * 5 (columns) ) bits represent the columns. The last three bits represent which row to latch when the enable line is activated. I'll try and find the arduino code and java code that I used to get the display working in the pictures. I'm sure that the code or comments will indicate the correct sequence and high/low values of the clock, data and enable lines.

Hope this helps, Matt

p.s. Did you pick this up at electronics exchange in STL?

oz
Site Admin
Posts: 542
Joined: Mon May 12, 2008 4:19 pm

Re: Atmega168 Serial Speed

Post by oz »

Maybe post some links on sources for this hardware for others that might be intrigued.

Paul

mlctrez
Posts: 4
Joined: Mon Jun 23, 2008 4:03 pm

Re: Atmega168 Serial Speed

Post by mlctrez »

I've put example code that can drive this board up on github. - Matt

https://github.com/mlctrez/tlcode

Dudemhccv
Posts: 9
Joined: Wed Sep 20, 2017 12:42 am

Atmega168 Serial Speed

Post by Dudemhccv »

Has anyone found an online retailer selling these drives?? I have the option of running them on my new system, but for the life of me I have yet to see any being sold anywhere. Not that I would rush out and by them now... I am sure they will be overpriced in a big way at launch. But they would be fun to have at some point.

Plus, I blieve that MaximumPC found the Serial ATA drives to be no faster then current ATA drives. So it might be a bit before they start to out perform the current drive spec.

EddieSsquic
Posts: 1
Joined: Wed Jun 05, 2019 1:44 pm

Atmega168 Serial Speed

Post by EddieSsquic »

I think its the cpu speed you need to improve .
midi side of things is ok .
so double clock the cpu and viola ???

Post Reply