help with pwm code
agfa
Posts: 295
i'm trying to troubleshoot a problem with some code and can't seem to pin point the source of the problem. i've posted the code. i know the code is sloppy, but please bear with me. i now know there are better ways to pass variables to assembly, but as an exercise i still wanted to make this work.
i'm trying to combine two 16 bit values to one 32 bit value "pass" to pass to the assembly routine. i believe the problem is with the assembly line "shr left, #16". the problem occures when the variable "left " exceeds decimal 511, or 9 bits. the instruction table on page 350 of the PM shows that the source and destination are 9 bit values but i thought that these could be used as pointers to long variables
edit: oops!·the code is·posted now.
Post Edited (agfa) : 8/23/2008 3:00:18 PM GMT
i'm trying to combine two 16 bit values to one 32 bit value "pass" to pass to the assembly routine. i believe the problem is with the assembly line "shr left, #16". the problem occures when the variable "left " exceeds decimal 511, or 9 bits. the instruction table on page 350 of the PM shows that the source and destination are 9 bit values but i thought that these could be used as pointers to long variables
edit: oops!·the code is·posted now.
Post Edited (agfa) : 8/23/2008 3:00:18 PM GMT
Comments
I would do something like this
Post Edited (Erik Friesen) : 8/23/2008 4:17:58 PM GMT
thanks for looking at it, and for the suggestion.
agfa
edit: could you clarify what the edit problem was?
Post Edited (agfa) : 8/23/2008 4:41:21 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.