Shop OBEX P1 Docs P2 Docs Learn Events
SX28 memory back switching (2K to 2K to 2K ect..) for subroutines — Parallax Forums

SX28 memory back switching (2K to 2K to 2K ect..) for subroutines

T&E EngineerT&E Engineer Posts: 1,396
edited 2006-01-06 01:26 in General Discussion
There is a good working example of how to switch between memory banks in the BS2p downloadable book on how to use subroutines in various memory banks.

How is this done on the SX-28 using SX/B?

I am thinking of porting my current project (BS2px) over to a SX-28 that has 2 programs in bank0 and bank1 (for the subroutine data).

If it involves alot of assembly language then I may not do it.

Basically what I am asking is how to I access more than 2 K of EEPROM space on the SX-28 preferably for a subroutine basis?

Thanks,

Timothy Gilmore

Comments

  • RsadeikaRsadeika Posts: 3,837
    edited 2006-01-05 21:47
    Timothy,

    In the latest version of SX/B, you no longer have to do bank switching in order to access all of the memory. You predifine your subroutines up front, and then code them, place them within your main like a command.

    Now, if you specifically want to use the bank technique, I believe you can still do that.

    Ray
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2006-01-05 21:54
    So what you are saying is that I can have access to all 16K (8 * 2K EEPROM space) by just simply declaring Subroutine statements?

    It can't be that easy. Is this true?

    I just want to be able to use a program that has a Lookdown table (as a subroutine if needed) that would otherwise be too big for the initial 2K of EEPROM space. I had to originally change from a BS2 to a BS2px (and was able to get it to work pretty much painlessly).

    Thanks,

    Timothy Gilmore
  • RsadeikaRsadeika Posts: 3,837
    edited 2006-01-05 22:11
    Timothy,

    I believe the SX/B 1.42 compiler gives you access to all of the banks without having to go through the misery of linking the banks within your program manually. Before , if you put a subroutine in, lets say bank 2, then you would have to call your subroutine with an @ in front of it.

    I remember the first program I did in the older version of SX/B, I was just typing in code and subroutines, the compiler did not tell you when you just left bank 0, and went to bank 1. Look in the latest help file for SX/B, it gives an explanation, better then me trying to paraphrase.

    Ray
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-01-05 22:14
    Ray is correct, SX/B flattens the program memory of the SX -- especially if one defines subroutines with SUB.

    Questions about the BASIC Stamp don't belong in this forum.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2006-01-05 23:44
    That is good news.

    My question was related to how to do something on the SX28.

    Timothy Gilmore


    Post Edited (tdg8934) : 1/6/2006 1:19:43 AM GMT
  • BeanBean Posts: 8,129
    edited 2006-01-06 00:55
    Tim,
    If you are asking if there is a way to have more than 2K of code on the sx28 ? If so then no there is no way to have more than 2K of code space.
    If your code doesn't fit you either have to optimize it, or switch to the SX48 (which has 4K of code space).
    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

    "I hope the goonwave is not vaporware"
    ·
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2006-01-06 01:26
    OK, My mistake.

    I was thinking for some reason that the SX-28 had (8) 2K banks of memory. No problem.

    Thanks Bean!
Sign In or Register to comment.