|
|||||||
![]() |
Forum Index > Projects > LED Pegboard and Matrix Projects |
|
|
Real time serial communication with Peggy 2? |
|||
| | | Printable Version |
|
Windell | ||||||||
|
Okay, my turn to do a multi-post post. I guess the 'benefit' that I was thinking of was having the hardware serial on the Arduino there to use. But if its not too complicated to add hardware serial to the ATMega168 on the Peggy (as mentioned above), then that would be a nice solution. Would that require that FTDI chip that is present on the Arduino?Okay... The ATMega168 on board *already* has a hardware serial port. When you hook up the USB-TTL cable, you are using this for input. However, we are reusing those two pins as part of the set of output pins that controls the LED matrix. So those two pins cannot be (normally) be used for serial communication at the same time that we're driving the LED array. (If and when there is a new version of the Peggy, this would be one of the things that I'd change. That could still be quite a while off.) You *could* rewire the lines that go to the two demultiplexer chips to work around this (and make corresponding software changes) but I suspect that this is not a very practical workaround for most people. So, the software serial works okay for low data rate communication (not 30 FPS, I'm thinking!), and TWI might work okay for faster communication. It's also possible that the SPI could be used as an input, but I'm not quite sure if or how that would work. Would that require that FTDI chip that is present on the Arduino?We are using the FTDI USB-TTL cable, which has the chip built in. This is an alternative to building in a chip on the board that lets you reuse the cable (and chip) in other places. On a side note, I can't seem to find a registration for the forums anywhere??Left-hand column, where it says "User Functions." To make the display truly modular (for large displays) would it be possible to have the lower circuitry either on the back of the board (I realize this might get really cramped.. if not impossible) or maybe 'piggy-backing' (no pun intended) as a separate board behind the matrix panel? Yes, we've thought of that as well. The Modern Device 8x8 uses through hole from both sides in their display and... we would rather not play that exact game. We could also add a piggyback board, but it adds more cost than you might think. (And it has the usual "mod problem": adds significant cost but does not add significant value for most users.)
The other thing is this: I assert that nobody needs Peggy to tile better. 625 LEDs is already a lot to solder. (I *do* speak from experience!) Do you really want to solder two sets of 625 LEDs and put them side by side? If so, great! Peggy 2.0 tiles left-right just fine. But you want to do FOUR sets of 625 LEDs and put them edge by edge? Okay, you can trim off the top edges and do that too. You want to do SIX panels, you crazy person? Go right ahead: 2x3 is fine, trim 6 top edges and use the side by sides. So, we don't even run into a problem until you want to scale up to a 3x3 matrix-- 5625 LEDs to solder and several thousand dollars invested. At this point, controlling that mega matrix gets to be a little bit challenging, and you can probably find some lower alternatives where the assembly time does not become quite so infinite.
On the other hand, we do have a few ideas for possible future projects that *might* make more sense to tile... but that's still a ways off. Windell H. Oskay drwho(at)evilmadscientist.com http://www.evilmadscientist.com/ |
![]() Admin ![]() Status: offline ![]()
Registered: 06/15/06 |
||||||||
|
|||||||||
|
voxel | ||||||||
Yes, we've thought of that as well. The Modern Device 8x8 uses through hole from both sides in their display
We are using the FTDI USB-TTL cable, which has the chip built in. This is an alternative to building in a chip on the board that lets you reuse the cable (and chip) in other places.
|
![]() Apprentice Status: offline ![]()
Registered: 05/28/08 |
||||||||
|
|||||||||
|
Windell | ||||||||
So armed with this cable, some rewiring and software changes I could add full hardware serial to the ATMega168 on the Peggy2... Right? Basically yes. (But note that we already support full hardware serial via USB with that cable and no other changes (for programming)-- we just don't support doing that at the same time as driving the LED matrix. As far as I'm concerned, this mod is borderline for too much work for the return. I think the hardware serial would be best because I'm considering putting two side-by-side and having them animate with real-time serial input from a PC. I disagree. Using the I2C (aka "TWI" or "wire" Also, what are the specifications of the 'Optional AC Adapter' ? What might be a good single-power-adapter solution if I wanted to use two Peggy2's beside eachother?4.5 or 5 V regulated, with 600 mA+ capacity. You could split a single 5 V 1 A power supply between two. Windell H. Oskay drwho(at)evilmadscientist.com http://www.evilmadscientist.com/ |
![]() Admin ![]() Status: offline ![]()
Registered: 06/15/06 |
||||||||
|
|||||||||
|
voxel | ||||||||
note that we already support full hardware serial via USB with that cable and no other changes (for programming)-- we just don't support doing that at the same time as driving the LED matrix.
Using the I2C (aka "TWI" or "wire" interface is a better idea because they can be both addressed on the same bus
|
![]() Apprentice Status: offline ![]()
Registered: 05/28/08 |
||||||||
|
|||||||||
|
Windell | ||||||||
What exactly do you mean by 'at the same time' ? Would it be possible to use the already-present hardware serial via USB for both programming and serial communication as is the case on the Arduino? (everything over same cable)The basic idea is this: You hook up the USB-TTL cable and program the Peggy with the Arduino software. When the upload completes, the Peggy runs the program, for as long as you leave it powered on. You don't have to unplug the USB-TTL cable, it just works. When you want to change the program, you just upload a new one. (Unplug the USB-TTL cable when you feel like it.) Now, what does Peggy do when it runs a program? There are a lot of different things that it could do. One is to configure its PORTD pins to use the serial port and talk to another computer. Another is that it could configure the PORTD pins to drive the LED matrix. You get to choose. It can do one after another-- it could periodically pause the LED display-- potentially for a very short time-- and retrieve new data to display. The only time that you run into conflict is if you need to run the display at the same moment as using the *hardware* serial port. Again, I2C may be the way to go. Ah yes, that would be much better. Like I said, I'm not very familiar with I2C, but that sounds like it would work nicely. How would I go about implementing an I2C connection from my PC to the Peggy? Would I be able to do it using the TTL USB cable?You could still use the USB-TTL cable to do the programming, but you would need to generate the I2C signal from another source. Here are some ways to do it. Using a USB-equipped Arduino (or a BBB with the USB-TTL) may be one of the best USB-I2C adapters available, with the right program added, of course. Windell H. Oskay drwho(at)evilmadscientist.com http://www.evilmadscientist.com/ |
![]() Admin ![]() Status: offline ![]()
Registered: 06/15/06 |
||||||||
|
|||||||||
| Content generated in: 0.77 seconds |
|
| All times are PST. The time is now 06:22 PM. |
|
|
technorati search
Subscribe to get new articles by E-mail:
|
|||||
|
Meggy Jr RGB
LED matrix game
development kit.
Business-card sized
AVR target boards
Peggy 2
LED Pegboard kits