In SX Microcontrollers, SX/B Compiler and SX-Key Tool, johncouture wrote: I must have the syntax incorrect, thus the reason for the question. In this program I store a 64 bit serial number in a byte array called "DS18B20". The problem is when I try to print each of the bytes out. Using [color=blue>Method] I call a subroutine called TX_NUM and hand it the DS18B20 address. It goes off and prints out a goofy number. In the second method[/color], I don't use the TX_NUM subroutine but rather print each of the eight bytes of the array using a simple for/next loop. This works great. Both routines use TX_HEX so that isn't the problem. It must be something to do with how I am handing the address to the subroutine. I was trying to pattern it after Jon Williams TX_STR routine but I am obviously doing something wrong. In analyzing the generated assembler code, the first method does a [color=blue>MOV] MOV __PARAMCNT, #1[/color] [color=blue>CALL] The second method passes the array differently as in: MOV W,#DS18B20[/color] [color=purple>ADD] MOV FSR,W[/color] [color=purple>MOV] BANK $00[/color] [color=purple>CALL] The first method seems to be saying that there is only 1 parameter (a byte) when there should be 2 parameters (a word)? Am I even close? ' variable declaration -------------------------------[/color] [color=blue>'] TX_NUM DS18B20 ' Thermometer Serial Number[/color] [color=blue> for temp3 = 0 to 7 TX_HEX DS18B20(temp3) next [/color] '----------------------------------------------------- ' Subroutines '------------------ SUB TX_NUM tempW1 = __WPARAM12 ' get string address FOR temp3 = 0 to 7 READINC tempW1, temp2 ' read a character TX_HEX temp2 ' send the byte NEXT ENDSUB SUB TX_HEX ' used by both so not important ENDSUB ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=283106 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)