Shop OBEX P1 Docs P2 Docs Learn Events
SX48 / SX52 setup and comparison to the SX28 question — Parallax Forums

SX48 / SX52 setup and comparison to the SX28 question

T&E EngineerT&E Engineer Posts: 1,396
edited 2007-03-19 02:09 in General Discussion
I have a couple of·SX52 protoboards from Parallax on their way because the SX48 protoboards are on back order. As I have never worked with these chips (only the SX28), I want to get a feel of what is different in them. From what I have been able to find out the major differences between them an an SX28 is a few more input commands and more I/O pins. What I don't understand is why the SX52 is being discontinued if it has more capability (meaning 4 additional I/O pins on RA) than an SX48. Was there a problem in manufacturing the die for them or something?

Also is there any header differences (or hardware setup with the SX-Key) I should be aware of when setting up an SX52 as compared to my normal header for an SX28?

If the SX28 header is:

DEVICE······SX28, OSC4MHZ, TURBO, STACKX, OPTIONX, BOR42
FREQ··········4_000_000

Would the·SX52 be:

DEVICE······SX52, OSC4MHZ, TURBO, STACKX, OPTIONX, BOR42
FREQ········· 4_000_000

??
«1

Comments

  • BeanBean Posts: 8,129
    edited 2007-03-09 13:42
    From what I understand the SX52 die is the same as the SX48. It was the package that was the problem.
    With the SX48/52 you don't need 'TURBO, STACKX, OPTIONX' on the device line.
    Just use:
    DEVICE SX52, OSC4MHZ, BOR42

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com
    Coming soon! Propeller based OSD module www.hittconsulting.com
    ·
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2007-03-09 13:50
    Thanks Bean!

    You always have the answers!

    I'm assuming that their is nothing else software/hardware wise different that I need to be concerned with then.

    Although I do have a couple other questions - How do I set up an array that will use RA, RB, RC, etc. (e.g. 24 byte array)? Would this be a word of only 2 (being RA and RB· or·· RB and RC , RD, RE, etc) or can I combine all of the outputs as a big array word?
  • JonnyMacJonnyMac Posts: 9,214
    edited 2007-03-09 14:45
    SX/B allows for the creation of [noparse][[/noparse]synthesized] word ports, so you can do something like this:

    Cathodes    PIN    RDE OUTPUT
    



    If you look at this list output for this you'll see that the TRIS registers for RD and RE are properly set. The other 16-pit port options are RBC and RCD.
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2007-03-11 15:58
    Thanks again JonnyMac!

    Now let me ask you, Bean or anyone who knows...

    If I was to set up a large LED matrix using an SX52, is their an easier method of usage on the arrays as it looks like the limitation is 16 bits (2 ports total)?

    I am thinking of most likely a 16x16 but would an 8 x 24 be possible too - array wise? I see that arrays can be up to 223 or so bytes but if the ports can only handle 16 bits then I think it makes more sense to build a 16x16 than an 8x24 LED matrix. Does this make sense?

    As you can guess, this is in reference to using·a modified·scrolling LED routine in the NUTS & VOLTS newest issue - CGoL (LIFE).

    Also - sounds like I would want to use a WDATA for the Col_Mask data statement too.

    Col_Mask:
    · WDATA %00000000_00001111
    · WDATA %00000000_00111100
    · WDATA %00000000_11110000
    · WDATA %00000011_11000000
    · WDATA %00001111_00000000
    · WDATA %00111100_00000000
    · WDATA %11110000_00000000
    · WDATA %11000000_00000011

    Thanks for everyones help!
  • JonnyMacJonnyMac Posts: 9,214
    edited 2007-03-11 16:20
    Remember that the SX is an eight-bit processor, so 16-bit values or bigger are in fact synthesized. SX/B will handle 16 bits for you, if you wanted to do 24 or 32 you'll have to code it yourself.

    BTW, your Col_Mask table has multiple bits enabled -- is that what you really want? Another option is to create the column mask in code:

    colMask = 1 << colPntr
    



    ... and if the column output bit needs to be low, add this:

    colMask = colMask ^ $FFFF
    



    With an 8-row by 24-column display I would do something like this:

      tmpB1 = colPntr
      IF tmpB1 < 16 THEN
        colMaskLo16 = 1 << tmpB1
        colMaskHi8 = 0
      ELSE
        colMask16 = 0
        tmpB1 = colPntr - 16
        colMaskHi8 = 1 << tmpB1
      ENDIF 
    
    



    It should be obvious that colMaskLo16 is a word and colMaskHi8 is a byte.
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2007-03-11 18:17
    One thing that is different is that the SX48 has twice the RAM, Twice the Program EEPROM, and you lose a couple bytes of low RAM storage since they are now used for the RD and RE ports where the SX28 can use them as RAM.

    The SX48 also has two 16-bit timers in addition to the regular 8-bit timer for the watchdog/RTCC. Apparently there is an error on the Parallax website about the SX48 as they only mention it has a single 8-bit timer and say nothing about the two extra 16-bit timers. Hopefully that will be fixed soon.

    You'll find the SX48 is a nice chip!

    Robert
  • T&amp;E EngineerT&amp;E Engineer Posts: 1,396
    edited 2007-03-11 18:38
    Thanks for the good input!

    I have started wiring the LED matrix for 16x16 (although there is room to change it to 16 rows x 24 columns-maybe later for that) as I thought this might be easiest to work with.

    I saw the WDATA statement in the example code for SX/B and was wondering about the set of 1111 digits too JonnyMac.

    I thought it should be like this:

    Col_Mask:
    · WDATA %00000001_00000001
    · WDATA %00000010_00000010
    · WDATA %00000100_00000100
    · WDATA %00001000_00001000
    · WDATA %00010000_00010000
    · WDATA %00100000_00100000
    · WDATA %01000000_01000000
    · WDATA %10000000_10000000

    I see more possibilities with a 16x16 in that it could be used to display crude pictures, 2 rows of scrolling text (clock on top, date on the bottom maybe), or anything that comes to mind.

    If it is to be 16x16, is it better to have it as (1) 16x16· OR· (2) 8x16's (one on top of the other visually speaking)- for ease of use with the SX52?

    ALSO can the SX52 handle a 16x16 LED display? I see that the SX28 can handle a 8x8 - as seen in the N&V article. I was going to use some driving transisors resistor circuits on one side (row·or column)·and ULN2003's on the other side (column or row) just in case. Let me know...

    Post Edited (T&E Engineer) : 3/11/2007 7:28:01 PM GMT
  • JonnyMacJonnyMac Posts: 9,214
    edited 2007-03-11 21:11
    You're supposed to be turning on one column at a time you need 16 entries in that table with just one active bit in each; that's why I suggested the math version at that point -- the table is getting pretty big.

    There's no reason why an SX52 can't handle a 16x16 display; you might use "port" RBC for the cathodes and RDE for the anodes. I think you're right to buffer the cathode wth a set of ULNs because now you could have 16 LEDs lit at the same time.
  • T&amp;E EngineerT&amp;E Engineer Posts: 1,396
    edited 2007-03-11 21:47
    I have (1) 8 x16 and (1) 4x16 wired up so far (with 4 more rows to add to the 2nd 4x16 making it another 8x16.

    However, I also just realized that having (2) 8x16's would require 6 ports (1 row and 2 columns)+(1 row and 2 columns) and the SX52 only has 5 ports which I wanted to use only 4 ports and have the other one for input controls or something.

    Yes I could use (2) SX-28's like the RobOympics with 4028 chips but it would be nice to have a 16x16 display for a large picture display or something in I would guess (2) 16 bit arrays.

    Can your math version still be used for a 16x16 or is it only for an 8x24?

    I will buffer both rows and columns transitor/resistor circuits for the anodes (rows) and ULN2003's for the cathodes (columns). This will invert them so that the 16 rows (transistor/resistor circuit) will be negative inputs coming in and the 16 columns (ULN2003 circuits)·will be positive inputs coming in.

    I beleive this is right.

    Thanks JonnyMac!
  • JonnyMacJonnyMac Posts: 9,214
    edited 2007-03-11 21:53
    Sure, just remove the lines of code that deal with the upper eight bits value -- now you have 16 columns. Read your anode values out of WDATA statements and it will operate very much like the 8x8 in my article, just bigger.
  • T&amp;E EngineerT&amp;E Engineer Posts: 1,396
    edited 2007-03-12 00:10
    Well - After 7 1/2 hours or so, I finished soldering my 16x16 LED matrix. I had about an inch of solder left. I have made them in the past but never one of this size. Can you believe that I was 1 LED short of having to open another 100 pack of red LEDs. Now I have 99 left for another project.

    Would it make any sense to·add more columns or leave it alone at 16x16?

    Time to go to Radio Shack after work tomorrow. I have about 2 inches on the left and right sides of the perf board (LEDs are in the middle and to the top). There is about 1 1/2 inches of perf board on the bottom of the LEDs. This should leave enough room for the transistor/resistor circuits on the right side of the LEDs and ULN2003 chips on the bottom (under the LEDs).

    I should have my SX52 proto boards on Tuesday which will leave me tomorrow night to solder the driver/buffer circuits and run wires or something to the SX52 proto boards.

    I very much appreciate all the help and encouragement today to you guys and especially JonnyMac.

    Thanks again!
  • T&amp;E EngineerT&amp;E Engineer Posts: 1,396
    edited 2007-03-14 10:48
    I got the SX52 protoboards in last night. I finished soldering in the transistor/resistor (negative in to circuit to Anodes - rows) AND·{(2) ULN2803's (8 outputs) not the (3) ULN2003's·(7 outputs) } (positive in to chips to Cathodes - columns) that I mentioned before. After that I soldered ribbon cable from the RB, RC, RD, RE from the SX52 protoboard to the 16x16 matrix board chips/transistor circuits.

    As an intial test, I have only changed the DEVICE·line and·added xxxx PIN RBC OUTPUT and·yyyy PIN RDE OUTPUT lines. I compiled and it was not correct (e.g. no WDATA statements yet or math code from JonnyMac) but It actually showed scrolling left, right, up and down. It was off·in the placement but that's ok for now - just need to fix the code.

    I·was more happy that I got through 3 nights of soldering all 256 LEDs and transistor/resistor circuits and ULN2803s and that all the LEDs came on as I hoped they would (even though they were not correctly displayed - just a mater of fixing the code). I would love to also display a picture or something at some point too on this new display. I think that by using WDATA on the RBC and RDE it should be possible.

    Thanks again to all especially JonnyMac!
  • BeanBean Posts: 8,129
    edited 2007-03-14 11:11
    Cool, how about some pictures ?

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "A problem well defined is a problem half solved"

    "Just because you're approved, doesn't mean you can afford it."
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Cheap used 4-digit LED display with driver IC·www.hc4led.com
    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com
    Coming soon! Propeller based OSD module www.hittconsulting.com
    ·
  • T&amp;E EngineerT&amp;E Engineer Posts: 1,396
    edited 2007-03-14 11:24
    Tonight after work I will get·my digital camera out and take some pictures.

    Thanks again for the great support!
  • T&amp;E EngineerT&amp;E Engineer Posts: 1,396
    edited 2007-03-14 21:14
    Here are some pics of the hardware. When I get the software working better, I will try to get some screen shots - this may take a while to experiment. Enjoy.
    640 x 480 - 155K
    640 x 480 - 146K
    640 x 480 - 146K
  • BamseBamse Posts: 561
    edited 2007-03-14 22:31
    Cool...

    I'm getting inspired...
    Let me see if I can find my soldering iron... wink.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Living on the planet Earth might be expensive but it includes a free trip around the sun every year...

    Experience level:
    [noparse][[/noparse] ] Let's connect the motor to pin 1, it's a 6V motor so it should be fine.
    [noparse][[/noparse] ] OK, I got my resistors hooked up with the LEDs.
    [noparse][[/noparse]X] I got the Motor hooked up with the H-bridge and the 555 is supplying the PWM.
    [noparse][[/noparse] ] Now, if I can only program the BOE-BOT to interface with he Flux Capacitor.
    [noparse][[/noparse] ] I dream in SX28 assembler...

    /Bamse
  • T&amp;E EngineerT&amp;E Engineer Posts: 1,396
    edited 2007-03-16 23:34
    JonnyMac / Bean,

    I have attached code that I beleive should work but doesn't. It is for my 16x16 LED display and based off of Jon Williams CGoL scroll routine in the March Issue of N&V. I have spent days trying many different routines. I can get 8x8 in any quadrant to work and even modified the interupt code to scroll backwards, forwards, up and down. But I can't get past the 8x8 LED boundaries (e.g. scroll or display anything past 8 LED's worth).

    Want I have attached is a program that should simply display 2 letters "S" and "X" but not scroll them. What I get is the letters repeated twice over 16 LEDs (by 8 high) AND the "S" is overlayed on top of the "X".

    I have not understood JonnyMac "math coding" to get rid of the DATA collumn masking. WDATA statements (I know - pointer = pointer + 2). What I usually see is the same·pattern repeated twice over the 16x8 display screen.

    Ultimately I would like to display data over all of the 16x16 LED display but for the moment I am stuck only seeing 16x8 and it is not displaying the information correct (as stated above).

    Can someone look at the code and tell me more specifically what I am doing wrong. I don't get it after I have been studing Jon's code, the RobOympic code, and other information I get on the web.

    Thanks for your support.
  • JonnyMacJonnyMac Posts: 9,214
    edited 2007-03-17 02:52
    I'm on my way out so I can only look quick -- in the ISR doing only one READ; this won't work because READ only works with bytes. You should alias the Anodes and Cathodes as

    AnodesLo
    AnodesHi
    CathodesLo
    CatodesHi

    ... so that you have complete control. Remember, words are synthesized and therefore not always convenient, and in some cases problematic. So, instead of:

    INT_HANDLER:
      Anodes = %00000000_00000000    
      READ Col_Mask + col, Cathodes        
      Anodes = dispBuf(col)                
      INC col                    
      IF col > 16 THEN                
        col = 0                    
      ENDIF
    



    I would do this:

    INT_HANDLER:
      Anodes = %00000000_00000000            
      READ Col_Mask + col, CathodesLo, CathodesHi    
      Anodes = dispBufLo(col), dispBufHi(col)    
      INC col                    
      col.4 = 0                    
    
    Update_Timer:
      IF ms > 0 THEN                 
        DEC ms                    
      ENDIF 
    
    ISR_Exit:
      RETURNINT
    
  • T&amp;E EngineerT&amp;E Engineer Posts: 1,396
    edited 2007-03-17 04:52
    Thanks JonnyMac.

    I have updated my code (attached). I got a little better results but still unsure about how to name the variable aliases.

    However, in all 4 8x8 quadrants I get only the last 8 bytes in the DATA statements. The first 8 bytes are not displayed.

    I would like to be able to enter data statements that represent what will be on the 16x16 display not just in the individual 8x8 quadrants.

    Please help when you can.
  • JonnyMacJonnyMac Posts: 9,214
    edited 2007-03-17 16:29
    Sometimes it's best to back away from a project and develop techniques for that project. Have a look at the program that's attached -- it's tiny, but shows that SX/B is quite clever and has some subtle tricks that will help you with your particular program. In just a few lines a code it shows how to store 16-bit elements in a table, retrieve those elements into a split array (since SX/B does not yet support word arrays), and move the elements of the split array back into a single 16-bit value for easy manipulation.
  • JonnyMacJonnyMac Posts: 9,214
    edited 2007-03-17 21:38
    Try the program that's attached (my update of your update of my program) -- if all works you'll get a smiley face in the display.
  • T&amp;E EngineerT&amp;E Engineer Posts: 1,396
    edited 2007-03-18 00:40
    JonnyMac,

    Thank you for taking the time to review the code. However, your code turns on all 256 LEDs and they stay on. Is there something I should check?

    I did notice that if I modify the COL.4 = 0 to something like COL.2 = 0 ... I got some "rounded" display which might be the form of the smiley face circle. For example if the display has the following look where X was off and O was on:

    XXOOOOOXXXOOOOXX
    XXOOXXOOOOXXOOXX
    XXOXOOOOOOOOXOXX
    XXOOOOOOOOOOOOXX
    XXOOOOOOOOOOOOXX
    XXOOOOOOOOOOOOXX
    XXOOOOOOOOOOOOXX
    XXOOOOOOOOOOOOXX
    XXOOOOOOOOOOOOXX
    XXOOOOOOOOOOOOXX
    XXOOOOOOOOOOOOXX
    XXOOOOOOOOOOOOXX
    XXOOOOOOOOOOOOXX
    XXOOOOOOOOOOOOXX
    XXOOOOOOOOOOOOXX
    XXOOOOOOOOOOOOXX

    Otherwise

    when col.4 = 0 I get all LEDs on
    like this:

    OOOOOOOOOOOOOOOO
    OOOOOOOOOOOOOOOO
    OOOOOOOOOOOOOOOO
    OOOOOOOOOOOOOOOO
    OOOOOOOOOOOOOOOO
    OOOOOOOOOOOOOOOO
    OOOOOOOOOOOOOOOO
    OOOOOOOOOOOOOOOO
    OOOOOOOOOOOOOOOO
    OOOOOOOOOOOOOOOO
    OOOOOOOOOOOOOOOO
    OOOOOOOOOOOOOOOO
    OOOOOOOOOOOOOOOO
    OOOOOOOOOOOOOOOO
    OOOOOOOOOOOOOOOO
    OOOOOOOOOOOOOOOO
  • JonnyMacJonnyMac Posts: 9,214
    edited 2007-03-18 01:16
    Hmmm....

    When I developing the 8x8 CGoL project I did the initial LED array testing without an ISR. You might create a scratch program -- without an interrupt -- that does something like this to validate the hardware:

    Main:
      Cathodes = %00000000_00000001
      DO WHILE Cathodes > 0
        Anodes = Cathodes
        PAUSE 500
        Cathodes = Cathodes << 1
      LOOP
    
      END
    



    This should march an LED across and up the display. Note that in my program, and I thought in yours, a "1" bit was on (either a column or a bit in a row).
  • T&amp;E EngineerT&amp;E Engineer Posts: 1,396
    edited 2007-03-18 01:56
    JonnyMac,

    I used your Smilley program and commented out the Interupt and Goto Interupt routine. I also commented out the Main program and copy and pasted your program in. See attached file.

    I think this part is not quite a success because the LED you describe is "off" as it starts from the top left and goes diagonal to the bottom right corner as the column of 16 LEDs (top to bottom) go accross the display (left to right).

    From the left side (all the rows in the first column turned on) and then it went to the next column until each column of 16 LED rows came on all the way to the right 16th column. Hopefully Im not getting my columns mixed up with my rows for you (eg. anodes and cathodes - depending on perspective).

    As you can see it had a diagonal effect of the row LED being off (e.g. X) each time it went from left column to ending right column.

    XXXXXXXXXXXXXXXXX
    OXXXXXXXXXXXXXXXX
    OXXXXXXXXXXXXXXXX
    OXXXXXXXXXXXXXXXX
    OXXXXXXXXXXXXXXXX
    OXXXXXXXXXXXXXXXX
    OXXXXXXXXXXXXXXXX
    OXXXXXXXXXXXXXXXX
    OXXXXXXXXXXXXXXXX
    OXXXXXXXXXXXXXXXX
    OXXXXXXXXXXXXXXXX
    OXXXXXXXXXXXXXXXX
    OXXXXXXXXXXXXXXXX
    OXXXXXXXXXXXXXXXX
    OXXXXXXXXXXXXXXXX
    OXXXXXXXXXXXXXXXX

    THEN

    XOXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXX
    XOXXXXXXXXXXXXXXX
    XOXXXXXXXXXXXXXXX
    XOXXXXXXXXXXXXXXX
    XOXXXXXXXXXXXXXXX
    XOXXXXXXXXXXXXXXX
    XOXXXXXXXXXXXXXXX
    XOXXXXXXXXXXXXXXX
    XOXXXXXXXXXXXXXXX
    XOXXXXXXXXXXXXXXX
    XOXXXXXXXXXXXXXXX
    XOXXXXXXXXXXXXXXX
    XOXXXXXXXXXXXXXXX
    XOXXXXXXXXXXXXXXX
    XOXXXXXXXXXXXXXXX

    THEN

    XXOXXXXXXXXXXXXXX
    XXOXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXXX
    XXOXXXXXXXXXXXXXX
    XXOXXXXXXXXXXXXXX
    XXOXXXXXXXXXXXXXX
    XXOXXXXXXXXXXXXXX
    XXOXXXXXXXXXXXXXX
    XXOXXXXXXXXXXXXXX
    XXOXXXXXXXXXXXXXX
    XXOXXXXXXXXXXXXXX
    XXOXXXXXXXXXXXXXX
    XXOXXXXXXXXXXXXXX
    XXOXXXXXXXXXXXXXX
    XXOXXXXXXXXXXXXXX
    XXOXXXXXXXXXXXXXX

    FINALLY IT ENDS LIKE THIS:

    XXXXXXXXXXXXXXXOX
    XXXXXXXXXXXXXXXOX
    XXXXXXXXXXXXXXXOX
    XXXXXXXXXXXXXXXOX
    XXXXXXXXXXXXXXXOX
    XXXXXXXXXXXXXXXOX
    XXXXXXXXXXXXXXXOX
    XXXXXXXXXXXXXXXOX
    XXXXXXXXXXXXXXXOX
    XXXXXXXXXXXXXXXOX
    XXXXXXXXXXXXXXXOX
    XXXXXXXXXXXXXXXOX
    XXXXXXXXXXXXXXXOX
    XXXXXXXXXXXXXXXOX
    XXXXXXXXXXXXXXXXX
    XXXXXXXXXXXXXXXOX

    XXXXXXXXXXXXXXXXO
    XXXXXXXXXXXXXXXXO
    XXXXXXXXXXXXXXXXO
    XXXXXXXXXXXXXXXXO
    XXXXXXXXXXXXXXXXO
    XXXXXXXXXXXXXXXXO
    XXXXXXXXXXXXXXXXO
    XXXXXXXXXXXXXXXXO
    XXXXXXXXXXXXXXXXO
    XXXXXXXXXXXXXXXXO
    XXXXXXXXXXXXXXXXO
    XXXXXXXXXXXXXXXXO
    XXXXXXXXXXXXXXXXO
    XXXXXXXXXXXXXXXXO
    XXXXXXXXXXXXXXXXO
    XXXXXXXXXXXXXXXXO <-·First was·X then went to·O.


    Post Edited (T&E Engineer) : 3/18/2007 2:15:25 AM GMT
  • JonnyMacJonnyMac Posts: 9,214
    edited 2007-03-18 03:25
    What I have (unsuccessfully) tried to convey is that you should test your hardware with simpler software (and "commenting out" big blocks of code is dangerous -- I rarely do it; the time spent on a small fresh program is not wasted) -- take a step before taking the whole trip. My CGoL program was much smaller than your 16x16 array and yet I still spent a lot of time developing and testing the hardware interface to get it to work. In the end looks simple, but that's because no one but me was around during the development process.

    This iterative, "Here's what I got, what do I do now?" process isn't going to help. You have to knuckle down and and figure out how to move one lit LED from a corner of the display to the opposing corner. When you can do that, you will have solved the hardware interface and can move forward with the program. You may actually have a hardware error. In my program a 1 bit in the column enabled it, and a one bit in a row turned it on. The demo above should only have one LED on at a time IF your hardware works as mine did.

    Post Edited (JonnyMac) : 3/18/2007 3:31:30 AM GMT
  • T&amp;E EngineerT&amp;E Engineer Posts: 1,396
    edited 2007-03-18 04:12
    JonnyMac,

    You have been a big help to me on this project. I will find out how to make the opposite of what I am seeing happen. From what I understand I should not have a full row of LEDs (top to bottom - moving left to right) on but only 1 in the row should be on (starting top left to bottom right). It is probably something simple that can be fixed with a NOT or ~ statement to either the Anodes or Collumns or possibly just need to invert the WDATA statements as they are being read in. I will let you know my progress in the morning.

    Thanks again for your persistence.
  • T&amp;E EngineerT&amp;E Engineer Posts: 1,396
    edited 2007-03-18 12:07
    JonnyMac,

    I got your code (modified) to work.

    Your test code:

    Main:
    ··Cathodes·=·%00000000_00000001
    ··DO·WHILE·Cathodes·>·0
    ····Anodes·=·Cathodes
    ····PAUSE·500
    ····Cathodes·=·Cathodes·<<·1
    ··LOOP

    ··END



    Your test·code (that I modified to get it to work):

    tmpW2···· VAR··· Word

    Main:
    · tmpW2 = %00000000_00000001
    · DO WHILE tmpW2 > 0
    ··· Anodes = tmpW2
    ··· Cathodes = ~tmpW2
    ··· PAUSE 500
    ··· tmpW2 = tmpW2 << 1
    · LOOP

    ··END

    As you can see by replacing Cathodes with a temp WORD variable AND then inverting the output it now produces a single LED·on·that starts at the upper left corner and goes diagonally to the bottom right corner. All other LEDs are off as they should be.

    Let me know what the next steps are now that this is ready.

    I have attached the code for your review.

    Thanks.
  • JonnyMacJonnyMac Posts: 9,214
    edited 2007-03-18 14:42
    Okay, now that you can control the display you should be able to move forward. I would suggest modifying the program ISR to look like this:


    INT_HANDLER:
      Anodes = %00000000_00000000                   ' clear anodes
      Cathodes = 1 << col                           ' set new column
      Cathodes = ~Cathodes
      Anodes = dispBufLo(col), dispBufHi(col)       ' get anodes for column
      INC col                                       ' point to next
      col.4 = 0                                     ' wrap from 15 -> 0
    
    Update_Timer:
      IF ms > 0 THEN                                ' delay timer running?
        DEC ms                                      '   yes, decrement
      ENDIF
    
    ISR_Exit:
      RETURNINT
    
  • T&amp;E EngineerT&amp;E Engineer Posts: 1,396
    edited 2007-03-18 14:58
    SUCCESS!!!

    I see the Smiley face on the 16x16 display. It is 90 degrees off (bottom of face points to left side) - but I think that is just a matter of changing the WDATA statements.

    I am so happy with this and your OUTSTANDING effort JonnyMac!!!

    Now - I will look at the previous coding and incorporate some scrolling routines to bring on other 16x16 pictures like the Smiley face.

    You are the best JonnyMac!

    Thanks again.


    See attached code.
  • T&amp;E EngineerT&amp;E Engineer Posts: 1,396
    edited 2007-03-18 18:12
    I have modified Bean's Excel Tile Calculator for a 16x16 grid and added WDATA statements that you can copy and paste from Excel into the SX/B program. I am not an excel expert but I am still working on getting the % next to the zeroes and ones.·For now·just delete the space in the SX/B program WDATA statements between the % and the zeroes and ones.

    I have made my own simple smiley face in the attachments.

    Pretty cool thanks to JonnyMac and Bean's Excel Tile Creator spreadsheet (both modified for this example program).

    Thanks again. Now - work on scrolling....
Sign In or Register to comment.