Searching \ for '[SX] Problem with SXSim' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: massmind.org/techref/ubicom/devices.htm?key=sx
Search entire site for: 'Problem with SXSim'.

Exact match. Not showing close matches.
PICList Thread
'[SX] Problem with SXSim'
2009\06\04@145306 by Valion/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Valio wrote:

Can somebody plz explain me why SXSim dosnt initialyze constant's

I have such code (taken from included samples):


                       ORG        $8 temp                DS        1                        ;temporary workspace
                       ORG        $10 acc0                DS        1                        ;pwm accumulators
acc1                DS        1
acc2                DS        1
acc3                DS        1
acc4                DS        1
acc5                DS        1
acc6                DS        1
acc7                DS        1 duty0                DS        1                        ;pwm duty cycles
duty1                DS        1
duty2                DS        1
duty3                DS        1
duty4                DS        1
duty5                DS        1
duty6                DS        1

The 0x and  1x row of reg file in simulator
have randon garbage instead initialized "1"
as it seen from code above.

Thanks.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=357018
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\06\04@150634 by PJMontyn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, PJMonty wrote:

Valio,
You're not initializing those variables, just setting aside space.  The "1" means "make this variable take up one byte of memory", not fill this variable with the number 1.

Thanks,
PeterM
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=357018#m357023
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\06\04@220340 by Valion/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Valio wrote:

I see Peter.

I thought vars could be initialized this way.

I took PWM.src example from "SX Assembly" directory of installation.
If it's so, means this code doesnt works, as far vars contain garbage?
Could you take a look plz.

All above means it not possible have pre-initialized variables and
they should be set by itself fro constant, right ?

Thanks,
       Alex
---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=357018#m357140
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\06\06@033306 by JonnyMacn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote:

I don't think that's the case, Alex.  While I don't have the code in front of me I have seen enough of Guenther's code to know that he clears the RAM at the beginning of his programs -- that would initialize all pwm levels and accumulators to zero.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=357018#m357486
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\06\06@034219 by JonnyMacn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote:

Alex,
You're a bit too quick to say the program "doesn't work" -- it does; what it doesn't do is initialize the PWM settings.  Random values in the duty* variables will be output to the port; the values in the acc* registers will be overwritten every time the interrupt runs so they're it doesn't matter that they're not initialized.  If you look at the code you'll find this comment:

;Interrupt routine does all PWM work, however, duty0-duty7 values may
;be updated here to modify individual PWM pin duty cycles.

This is an invitation to set one of more of the duty* variables before running the loop.  You can use mov for a non-zero value of clr if you want to set a duty cycle register to zero.

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=357018#m357491
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

2009\06\06@110302 by Zootn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Zoot wrote:

e.g.


acc0        DS    1            ;pwm accumulators
acc1        DS    1
acc2        DS    1
acc3        DS    1
acc4        DS    1
acc5        DS    1
acc6        DS    1
acc7        DS    1 duty0        DS    1            ;pwm duty cycles
duty1        DS    1
duty2        DS    1
duty3        DS    1
duty4        DS    1
duty5        DS    1
duty6        DS    1
duty7        DS    1 ; to get a nice round half bank
; clear duty registers
CLR duty0
CLR duty1
CLR duty2
CLR duty3
CLR duty4
CLR duty5
CLR duty6
CLR duty7
; or loop it....
MOV W, #duty0
MOV FSR, W
:loopme
CLR IND
INC FSR
JNB FSR.3, :loopme

---------- End of Message ----------

You can view the post on-line at:
http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=357018#m357554
Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com
The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)

More... (looser matching)
- Last day of these posts
- In 2009 , 2010 only
- Today
- New search...