Combining hardware and software on 2 or more SX28's (Daisy chain?)
T&E Engineer
Posts: 1,396
Is there anyway to link 2 or more SX28's together with software / hardware. I guess the same would be true for BS2 series.
I am working on a LED message display sign and using the ROBOLYMPIC code as a baseline - but this will only handle 16 columns due to variable array limitations (e.g. Display(16)). I would like to possibly daisy chain them together and link the software somehow to work together.
Is this way out in left field or possible?
Comments...ideas
Thanks,
Timothy Gilmore
I am working on a LED message display sign and using the ROBOLYMPIC code as a baseline - but this will only handle 16 columns due to variable array limitations (e.g. Display(16)). I would like to possibly daisy chain them together and link the software somehow to work together.
Is this way out in left field or possible?
Comments...ideas
Thanks,
Timothy Gilmore
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·1+1=10
And while arrays are limited to 16 bytes in the SX28 (with SX/B), I have shown how you can create a bigger array by linking them togther -- have a look at the Serial Inkjet Printer code that I posted in this forum; it links four banks together to create a 64-byte array (that is used as a circular buffer).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
I know you told me how to daisy chain arrays together but you also told me it would not work in my application either. This is why I am trying to find another way. I see that the ROBOLYMPIC code also uses an Interrupt. Is this necessary for speed issues?
Anyway, I am trying to just see if there is another way with what I have (SX28's and BS2 and BS2PX {should arrive today-BS2PX}) as the PDB doesn't support the SX48 anyway.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
You have always been on top of issues for new beginers like myself and I do appreaciate everything you have done to assist me and others.
However, You did state in a past post:
==========================================
In my example code "colPntr" is an alias for RB (just as "LEDs" is an alias for RC). I don't think it's a good idea to embed the port name into the code like you're doing because it makes reassignment more work later. That's just a style choice. And, of course, I forget that your outputs a inverted so I've edited my example code accordingly.
With the SX28 you can't have an array larger than 16 bytes, so this won't work in your program:
· LEDs = colBuf(colPntr)
The example shows how to use bit 4 of the pointer to detect which portion of the array to grab the current column data from.
=============================================
I am only pointing out what I read and do not mean to have any personal attack. I see limitations in the SX28 and only trying to find another solution to the problem.
Thanks again for all of your great support!
Timothy Gilmore
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
In the post you quoted, Jon said:
"With the SX28 you can't have an array larger than 16 bytes, so this won't work in your program."
Earlier in this thread, he wrote:
"And while arrays are limited to 16 bytes in the SX28 (with SX/B), I have shown how you can create a bigger array by linking them togther"
You wrote:
"I know you told me how to daisy chain arrays together but you also told me it would not work in my application either."
Re-read what I just quoted up above. Jon didn't say chaining arrays wouldn't work. In the very piece of text you quoted, Jon says nothing about chaining arrays not working. He simply says you can't have arrays larger than 16 bytes in an SX28 program. I'm not sure how you went from a statement about single array sizes to a conclusion about chaining arrays. It seems like you might be skimming more than reading.
Thanks, PeterM
You can do this in SX/B for the SX28
Ary1 VAR Byte (16)
Ary2 VAR Byte (16)
Ary1(32) = 1 ' This sets Ary2(0) = 1
Ary1(33) = 2 ' This sets Ary2(1) = 2
In effect there is 16 non-existant elements between arrays (if the arrays use a full bank of 16 elements).
So you can do something like this (step though with the debugger to see how it works)...
'
DEVICE SX28,OSCXT1,TURBO,OPTIONX,STACKX
FREQ 4_000_000
A VAR Byte
B VAR Byte
Ary1 VAR Byte (16)
Ary2 VAR Byte (16)
WATCH Ary1,8,udec
WATCH Ary2,8,udec
WATCH A
PROGRAM Start NOSTARTUP
Start:
· FOR A = 0 to 31
··· B = A ' Make copy of index value 0..31
··· ' Make copy of index 0..15, 32..47
··· B.5 = B.4
··· B.4 = 0
··· Ary1(B) = A
· NEXT
BREAK
· GOTO Start
END
'
Bean
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
Those that would give up freedom for security will have neither.
Post Edited (Bean (Hitt Consulting)) : 11/29/2005 6:39:57 PM GMT
I'm tossing in the towel -- if you can make the subroutines I've attached work for you, great.· If not, I will leave it to my smarter friends to assist.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Post Edited (Jon Williams (Parallax)) : 11/29/2005 11:35:00 PM GMT
Jon - I hope we can call a truce as I certainly didn't mean to upset you. You and others from Parallax, incl Bean and a few others on the forum have provided great support.
I have taken your previously attached code and I think I have it close now to what I want done to display data on an LED matrix.
However, it won't compile with an incorrect statement in the Interrupt code area (it is commented so you can see it).
'
INTERRUPT
'
ISR_Start:
'RC = 0······ 'CLEAR DISPLAY OUT TO PREVENT GHOSTING
'Inc RA······ 'INCREMENT COLUM ADDRESS (RA I/O PINS)
'RC = NOT Display( RA )···· 'LOAD NEW ROW DATA TO RC
RC = 0
Inc RB
testVal = GET_BIG RB·' PROBLEM IS THIS LINE OF CODE ??????
RC = NOT testVal
If RB > 63 then
RB = 0
EndIf
ISR_Exit:
RETURNINT 63
++++++++++++++++++++++++++++++
testVal = GET_BIG RB·
'or any value or number in place of RB (e.g. 0, 63, etc.) does not work.
However in the LOAD64 subroutine the "testVal = GETBIG pntr" does work. I tried moving the SUB statements before the Interrupt section, but it made it worse.
Any ideas?· Anyone?
PS: I just received my BS2PX from Parallax today (UPS misrouted it and it took it a week overdue to get to me). I will start looking at this too to convert this code over LATER if possible (but no interrupts on the BS2PX).
Thanks,
Timothy Gilmore
If you want to call subroutines from an interrupt to have to use an interrupt jump.
Like So...
INTERRUPT
GOTO MyInterrupt
' Define your subroutines here (you CANNOT define them before "INTERRUPT")
MyInterrupt:
' blab blab blab
RETURNINT
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
Those that would give up freedom for security will have neither.
·
I don't know if you have solved your challenge yet, but in case you have not, you can peek at my post on 9/28/05 for an example and code to sync any number of SX's together.
I still write everything in assembler, so I'm not sure how it will be impacted by SX/B, but probably you can deal with that.
In the code examples it is imperative that all synced units run at the same interrupt rate and no varying length (time) code exists prior to the sync code in the ISR. Resonators are sufficiently precise because resyncing happens at at the regular IRS rate.
If you need more help just let us know.
Cheers from Maui, Hawaii,
Peter (pjv)
Post Edited (pjv) : 12/1/2005 8:53:10 AM GMT
Thanks guys for your assistance. I will look into it.
BTW PJV...I see that you are from Maui. I have been all over the world during my·past Navy tours. However, I took my wife (at the time) to Maui as a second Honeymoon about 20 years ago. It was by far the best place I had ever been to. I envy you! Enjoy.
Post Edited (tdg8934) : 12/1/2005 12:50:06 PM GMT
Don't get excited I'm actually from Canada....I'm just here in Maui for two weeks of vacation. Great place, been here many times...it's minus 20 C at home right now.
And of course I am fortunate to have a free high speed wirless connection to my laptop, so I can stay in touch with the office.
And naturally I brought my Prof Dev Brd, small parts, SX-Key etc., but didn't have enought room in the suitcase to drag my trusty scope along. Oh well, you can't have everything!
Cheers from Maui, Hawaii,
Peter (pjv)