Notifications
Clear all

Mega and 2 FC-16 Modules

60 Posts
4 Users
6 Likes
3,993 Views
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@will Maybe I am missing something. If you daisy chain more modules (it's already 4 long) the data just scrolls from the one set of 4 to the next set of 4 OR you can display ONE buffer with up to 64 pixels. He would be way better off and not too difficult to program a TFT with 320 x 240 pixels.Β 

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2535
 
Posted by: @zander

@will Are you sure? ItΒ 's a MEGAΒ 

No, I'm not sure about anything any more πŸ™‚

But you'll notice that everything there is in the singular. There is only 1 MOSI, 1 MISO, 1 SCK and 1 SS pin specified. My reading is that there is only one bus. It's supposed to be serial, so how many would one need ?

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@will AND how will he connect the PC's to the Arduino?

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2535
 
Posted by: @zander

@will Maybe I am missing something. If you daisy chain more modules (it's already 4 long) the data just scrolls from the one set of 4 to the next set of 4

That's why I think a daisy chain with a cable to allow him to arbitrarily place the second unit might work.

He would be way better off and not too difficult to program a TFT with 320 x 240 pixels.Β 

Then he'd need two of them, but IIRC he wasn't happy with the OLED size, so TFTs might fail on that aspect too.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2535
 
Posted by: @zander

@will AND how will he connect the PC's to the Arduino?

NMP (not my problem πŸ™‚

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@will 320 pixels is the equivalent of 40 of the panels he now has but he might want bigger chars. But if not, he could display both data streams on one panel. Again, no real requirements statement.

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
ReplyQuote
Alan L
(@alan-l)
Member
Joined: 2 years ago
Posts: 28
Topic starter  

Thanks guys. I will start fresh in the morning and breadboard up a single FC-16 which is the 8 x 32 module.

The data I hopefully will receive will be in the form of numbers such as 1234.

The Mega will indeed be connected to a PC via USB.

I am aware of what a buffer is used for however I have never created one! πŸ™‚

Ron - understand to setup one display for SPI. Not sure what you mean by then moving onto 2 SPI pins.Β  Is there not but one SPI on a Mega?

Thanks


   
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@alan-l YEP, only 1. I think what you want to know is here. Turns out my first guess was right, you use CS to select which set of panels to write to. Simple code, just create a procedure to do the work and pass through the panel set (used to choose which CS to use), buffer address for the data). Take the sample code and copy the main loop code to a procedure. Then change the key variables to parameters. Now code a new main loop that reads your inputs and moves the data to one of two buffers, now call the created procedure with CS1 and &Buffer1, then CS2 and &Buffer2, read data, loop back and check for termination condition. Preface each sub call with a test to determine new data is ready. An interrupt driven approach for the inpt would be the ultimate solution and if applicable another set of interrupts to determine buffer empty so try another write. Confused?

https://www.circuitbasics.com/how-to-set-up-spi-communication-for-arduino/

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
Inst-Tech reacted
ReplyQuote
Alan L
(@alan-l)
Member
Joined: 2 years ago
Posts: 28
Topic starter  

Confused????? and then some but I do not expect to get it on the first go around!Β  πŸ™‚

Best part of this is I will learn a great deal which keeps my mind active. I am 74 years young and do find this enjoyable!

Thanks again!

Β 

Β 


   
Inst-Tech reacted
ReplyQuote
Ron
 Ron
(@zander)
Father of a miniature Wookie
Joined: 3 years ago
Posts: 7028
 

@alan-l Here is the part of the documentation that is relevant. Memorize all of this to start, that what we programmers do, OR at least be familiar enough with it that you know where and when to look something up.

https://www.arduino.cc/en/reference/SPI

This section is the secret to what you want to do. It should be self explanatory, but if it isn't, ask.

Screen Shot 2022 02 27 at 21.36.22

First computer 1959. Retired from my own computer company 2004.
Hardware - Expert in 1401, and 360, fairly knowledge in PC plus numerous MPU's and MCU's
Major Languages - Machine language, 360 Macro Assembler, Intel Assembler, PL/I and PL1, Pascal, Basic, C plus numerous job control and scripting languages.
Sure you can learn to be a programmer, it will take the same amount of time for me to learn to be a Doctor.


   
Inst-Tech reacted
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1697
 

Hi @zander, @will and @alan-l,

Β Β  I hate to spoil your fun, but there might be another issue ... and I am not sure how much of a problem it is, but something to at least be sensitive to. (Forewarned is forearmed?)

It seems each 8x8 module is driven by a 72xx chip ... and the 'unknown unknown' lies with the 'xx' bit

As far as I can tell the 7219 and 7922 originated from Maxim.

Each of these chips can drive 64 LEDs in a row/column style matrix arrangement, using 16 pins from the chip. It is obvious how that works with the 8 x 8 individual square modules you are discussing.

However, a glance at the Maxim web data suggests the 7219 was aimed at driven 7 segment displays, which were often '8 segment', the 8th segment being a decimal point style dot., And the other 8 drive pins enabled 8 such 7/8 segment displays to be driven. Thus a single chip could provide an 8 digit display with a 'moveable' decimal point. For most applications, it was probably not intended to have more than 1 such chip in a unit, although it does alllow more than 1 to be cascaded in a shift register fashion for odd applications that actually needed more than 8 digit readout. My guess is it also preceded SPI in general usage (and even microcontrollers) by a few years, so it wasn't designed for SPI use.

To get around this, Maxim have superseded the chip with the 7922, which at a first glance at the data sheet appears to be very similar, except for pin 12, which is a 'Load' pin on the 7219 and a not-CS pin on the 7922.

See https://datasheets.maximintegrated.com/en/ds/MAX7219-MAX7221.pdf, from which I note:

image

So, treating this as a 'standard SPI' may be hazardous to your sanity ... especially if you don't know which chip your particular 'panel' is based.

The adverts I saw did not specify which chip they were based on. My 'junk box' has a single, as yet untried, 8 x 8 square that came as a part of Mega2560 package deal from BanggoodΒ  ... it is not as neat as the clip together ones I have seen in the photos, but the chip is clearly marked MAX7219, though there is no obvious sign of a Maxim logo, so I assume it is a cloned chip.

If the intended modules are 7219 based,Β  ideas of having two chip select pins, and 'sharing clock and data pin drives, may still be possible, but they may require a little more thought and 'fine tuning'.

In principal, microcontrollers can be programmed to do a wide variety of things ... but libraries from Arduino, etc. are great for putting a system they are designed for ... however, even small modifications sometimes require digging into the lower lever 'magic', which can increase the complexity by an order of magnitude or two.

----------

The other concern is one of electrical drive to two different places from the same pin. If the arduinos and displays are very close ... say a few centimetres apart, then this probably not a problem, but if they are a significant distance, then transimission line effects start crawling out of the wiring. I haven't seen any specification as to the wire lengths, so this might not be an issue, but it should be realised that this can easily become a problem. This partly depends on the data rate, which is also unclear to me at the moment.

--------

If you are 'stuck', have you considered two Arduinos? I don't know your situation, but if this is a 'one-off', then two Arduinos might be easier, assuming you can drive two USBs from your controlling PC, even if it does feel like a massive overkill. I am not recommending the approach, just suggesting it as possible fallback.

--------

I am sorry if this sounds negative, and it is quite possible there are easy answers.

Good luck with the project. Dave

Β 


   
Inst-Tech reacted
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2535
 

@davee FYIΒ @zander and @alan-l

I believe that you can daisy chain two of the 4-digit displays together and pump in 8 values which will result in them being passed on between the modules.

If you use a long cable to link them, you should be able to position them independently.

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1697
 

Hi Will,Β  @zander, @will and @alan-l,

Β Β  I suspect that you can daisy chain two modules and make them work with a short interconnection .. and I tend to agree this is most likely to work with the existing software libraries without requiring too much 'fixing' ...Β  however, extending to a 'long' interconnection is likely to be troublesome.

What lengths are 'short' and 'long'Β  in this context is tricky ... a few centimetres is probably fine ... after that it is like walking up a hill that gets progressively steeper .. you get to a point where each step up results in you sliding back. Exactly, which point that happens depends on your shoes that day, is the surface wet and so on.Β 

There are too many unknowns without mocking it up as an experimental rig, to give a definitive answer.

It might be the displays only need a short joining wire .. in which case .. no problem. Until you know, don't worry about it, but unfortunately you can't make progress either.

Best wishes all, Dave


   
ReplyQuote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2535
 
Posted by: @davee FYIΒ @zander and @alan-l

There are too many unknowns without mocking it up as an experimental rig, to give a definitive answer.

It might be the displays only need a short joining wire .. in which case .. no problem. Until you know, don't worry about it, but unfortunately you can't make progress either.

AFAIK no details of positioning or construction have been given, so the distance between the two displays is unknown to us (and maybe to the OP as well, depending on the state of progress of the project).

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
Alan L
(@alan-l)
Member
Joined: 2 years ago
Posts: 28
Topic starter  

Thanks for all the inputs ans concerns. I am happy to say I have succeeded in achieving my goal. I have 4 of the modules functioning the way I want them to and they are approx 6 ft away from the Arduino.

I am pleased with the outcome and have learned a great deal!

Β 

Β 

Regards - Alan


   
DaveE reacted
ReplyQuote
Page 4 / 4