Strange SX-48 Behavior
I have been running the TX_HEX2 subroutine that is in the example programs and had it work successfully. Now all of a sudden it prints $E for the second digit regardless of what the input is.· Watching it in single step mode, what is happening, no matter what the character stored in the tmpB2 register the W register is getting loaded with $FE.· I put in a \ Mov W,#0 command prior to loading the tmpB2 but to no avail.· It loads $FE in the W regester.
I tried moving the Subroutine code to another page, again the same problem.
Anyone have any ideas?
Jim
·
I tried moving the Subroutine code to another page, again the same problem.
Anyone have any ideas?
Jim
![roll.gif](http://forums.parallax.com/images/smilies/roll.gif)
Comments
Can you post the code?
regards peter
Post Edited (JonnyMac) : 8/11/2008 5:25:30 PM GMT
Thanks for the insite. I am using an interupt driven version of your code for TX and RX. The TX-HEX2 sub I think I used from the help file on SXB
I will lookinto it. Thanks
Jim
[noparse][[/noparse]Edit] Added BIN8 and DEC3 output routines
[noparse][[/noparse]Edit] Improved and updated -- see post below
Post Edited (JonnyMac) : 8/19/2008 5:19:44 AM GMT
That solves all sorts of problems! Now I have to recalculate the baud rate constants for a 20 MHz xtal, but I believe I have downloaded a calculator that does all that for virtual periferals. I was going to put the __default in an ifdef statement but it did not want to compile right so will figure that out later.
Jim
I didn't have any trouble with a conditional compilation setup for the __DEFAULT constant. See attached.
Post Edited (JonnyMac) : 8/19/2008 5:23:01 AM GMT
leave it to me to do things the hard way.· I was having trouble trying to determine how to set the interupt rate until I figured out that it was the recipricol of the interupt timing. The problem I had with the if def was failing to write it with the ' in front of the { . When I looked at your example I saw the error of my ways.· You might emphasise the importance of the '{ } structure in an example in the help file.· One of the difficulties I have in reading the help file is that the highlighted segments sometimes mask important features like a comma after a command statement or a ' infront of something.
Thanks again for all you do!
Jim