Shop OBEX P1 Docs P2 Docs Learn Events
SX/B RAM to RAM move — Parallax Forums

SX/B RAM to RAM move

John CoutureJohn Couture Posts: 370
edited 2006-02-16 17:43 in General Discussion
I think I'm just getting tired.· What I want to do is call a function that will copy 8 bytes from one ram variable to another.· Something like:

'

' variable declarations
DSTemp···· var byte(8)
DSDir····· var byte(8)
DSSpeed··· var byte(8)
SerialNum· var byte(8)
.
.
'

'subroutine call in main program
··· ' program figures out the serial number and stores
··· ' it in SerialNum array
··· copySerialNumber DSTemp·


'

' subroutine definition
copySerialNumber:
···· temp1 = __Param1
···· for temp2 = 0 to 7
········· temp1(temp2) = SerialNum(temp2)
·····next
···· return··

P.S. YEA!· I FINALLY figured out the 1Wire protocol and have got the AAG weather station talking to the SX18.· The above is so that I can optimize the code and be able to fit all four routines (search,temp,speed,dir) into one program (however I'll probably have to use an SX48/52 for the additional memory.





▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
John J. Couture

San Diego Miramar College

Comments

  • BeanBean Posts: 8,129
    edited 2006-02-16 12:07
    John,
    · Try this:
    copySerialNumber:
         temp1 = __Param1
         for temp2 = 0 to 7
              __RAM(temp1) = SerialNum(temp2)
             INC temp1
         next
         return  
    
    

    When you pass an array name to a subroutine you are actually passing it's ADDRESS in the virtual __RAM array.

    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

    "Ability may get you to the top, but it takes character to keep you there."
    ·
  • Mike CookMike Cook Posts: 829
    edited 2006-02-16 12:09
    John,

    When you get finished with this I hope you will post in the 'projects' section. Converting the Nuts & Volts article: 'Weather on a Wire' to the SX48/52·has been on my TODO list for a while!

    Mike



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "OEM NMEA GPS Module" Now available on ebay for only $17.49

    Product web site: http://www.allsurplus.net/Axiom/
  • John CoutureJohn Couture Posts: 370
    edited 2006-02-16 17:43
    Thanks Bean!

    Yes, I do plan on posting it as soon as I clean it up and insert some meaningful comments.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    John J. Couture

    San Diego Miramar College
Sign In or Register to comment.