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

Exact match. Not showing close matches.
PICList Thread
'[SX] software reset'
2006\12\28@043020 by electronicn/a

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

hi SXers
I have written an SX28 general purpose pulse generator program that functions as expected. I now wish to use the interrupt routine to modify the program parameters (ie pulse on and off times) while the program is running. My program uses two different pulse generating subroutines depending on the output pulse times; one subroutine uses 8bit time constants (the first 8bits of 32bit word) for narrow/fast pulses, the other subroutine uses 32bit (the complete 32bit word) time constants for wider/slower pulses. The program decides which subroutine to use depending on the number of populated bits in the 32bit word time constants after reading the user input from the up/down keys. I do not wish to check the keyboard during the pulse generating subroutines because this will reduce the maximum frequency and increase the minimum pulse width that can be generated. If the program returns from an interrupt with time constants out of range (after user modification) for the calling subroutine a problem occurs !!!!

Is it possible to return from the interrupt routine to a different point than called from?

or
Is it possible to software reset the processor during the interrupt subroutine to clear the stack and interrupt status?

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

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

2006\12\28@050708 by beann/a

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

Electronic,
 I'm assuming that the up/down buttons cause interrupts ?
 Why can't you check the time constants in the interrupt before returning ?

 Usually the interrupt is used to generate the pulses, and the main code handles the user interface. But maybe you have good reason to do it the way you are ?

 If you could post your code it would make it easier to assist you without having to guess.

Bean.

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

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

2006\12\28@054039 by electronicn/a

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

Bean,
Yes, I am using the up/down keys to trigger the interrupt routine.

I can check the time constants before returning but I need to return to different routines depending on actual values of the time constants. Hence my first question.

I am using the main code to generate the pulses in order to allow me to generate very narrow/fast pulses without interrupt routine latency delays of 5 cycles. Using my main code subroutine I can generate pulses 5 cycles wide (or less with extra subroutines). I am trying to optimise the code to take full advantage of the SX28.

Many thanks for your help.

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

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

2006\12\28@153125 by electronicn/a

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

hi Peter
Many thanks for this information on secret SX instructions. I may be able to POP/PUSH the stack as on the Z80 to solve my problem.

Best regards
electronic
---------- End of Message ----------

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

2006\12\28@190311 by Peter Van der Zeen/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Peter Van der Zee wrote:

Hi Electronic;
Or perhaps not, it's not as easy as you might think.

As Bean and I both suggested, more information would be very useful. Without that, you are just keeping us guessing, and there's not much point in that ..... at least not for us !

Cheers,
Peter (pjv)
---------- End of Message ----------

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

2006\12\28@214714 by electronicn/a

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

Hi Peter and Bean
I expect that assembling these secret SX instuctions will require manual assembly of the final code by replacing inserted 'nop' instructions with the required secret POP/PUSH code bytes. Plenty of chances to make silly mistakes! I will experiment with this method and report if it is sucessful.

The main pulse generator program itself is nothing special at all, just standard practice; i.e. a simple closed loop containing two time delay sections seperated by output port write instructions copied from an old Z80 program I wrote back in the 1980's . My efforts to use the interrupt routine are solely to remove the extra time in the loop required to check the keys for user input. If the interrupt routine method is unworkable I will just revert to checking the keys inside the loop. This will result in a pulse generator with wider minimum pulse width and lower maximum PRF. In practice this may not be a big problem for a general purpose pulse generator product.

Best regards
electronic
---------- End of Message ----------

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

2006\12\28@221801 by Peter Van der Zeen/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Peter Van der Zee wrote:

Hi Electronic;
I think I know what you are trying to do, but I'm still guessing. While buttons are being pushed, the pulses cease or get messed up, and that's OK then ?

If you could 'zoom out' a bit, and give us an overview or set of specs you are trying to meet, it would be helpful.

Cheers,
Peter (pjv)
---------- End of Message ----------

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

2006\12\29@021743 by g_daubachn/a

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

Hi all,
there is another "tricky" way to soft-reset an SX: The watchdog timer. If you activate it together with a prescaler setting of your choice, make sure that a CLR !WDT instruction is executed often enough in the "regular" program loop. In case you want a soft-reset, just keep the program running in an endless loop without clearing the watchdog timer, and it will reset the SX after it has timed out. There is no problem, placing the endless loop inside the ISR code, as further interrupts are disabled as long as no RETI, or RETIW instruction is executed.

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

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

2006\12\30@043650 by electronicn/a

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

Hi GŁnther et al.

Thanks for the information on reseting the SX using the WDT. This method would only require one turbo machine cycle inside the signal generator loop to implement. I will try using this if there are problems with the PCstack modification method using the secret instructions sugested by Peter (pjv).

Is it possible to soft-reset the SX28 by jumping to the top of program memory? will SXsim simulate this condition as the SX28 behaves?

Best regards
electronic
---------- End of Message ----------

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

2006\12\30@090130 by g_daubachn/a

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

Hi electronic,
jumping to any location outside of the ISR, like to the top of program memory would mess up the shadow registers, as the RETI, or RETIW instruction is not executed. The same is true for the return stack when you try to jump to some address outside of a subroutine without executing a RET, RETW, or RETP instruction.

I have tried SXSim together with a jump to the top of program memory from within an ISR. SXSim stays in an endless loop, always jumping to the top of program memory. I'm not sure if the "real silicon" behaves the same but at least, SXSim does not simply ignore this "illegal" code.

BTW: You can also soft-reset the SX w/o using the watchdog by connecting a free port pin to the *MCLR pin. Configure this port pin as an input (high Z) by default. In case you want to soft-reset the SX, make this pin an output with low level. This will pull low the *MCLR pin, and cause a reset. As a reset automatically configures all port pins as inputs (high Z), *MCLR will be released automatically after the soft-reset.

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

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


'[SX] software reset'
2007\01\03@020341 by electronicn/a
flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, electronic wrote:

Hi Gunther, Peter (pjv) and the group
Many thanks for your information on jumping to the end of program memory in a crude attempt to reset  the SX. Your hardware "tunnel" solution (MCLR wired to a port pin) looks very interesting for many applications.

I have now tried the secret stack instructions popPC/pushPC ($04F/$04B) in an attempt to force a return from interrupt to my required program entry point instead of the interrupted program location. Unfortunately my experiments show this does not work because the PC interrupt stack is different from the PC subroutine stack; the secret instructions popPC/pushPC ($04F/$04B) operate on the PC subroutine stack.

Does anybody know secret instructions that modify the single layer PC interrupt stack ?

Best regards
electronic
---------- End of Message ----------

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

2007\01\03@081357 by Peter Van der Zeen/a
flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Peter Van der Zee wrote:

Hello Electronic;
The secret PUSHPC/POPPC operate on the two level program counter shadow stack..... NOT on any subroutine/call/ret stack.

In order to return from interrupt to a place different than the interrupted code, ALL the shadow stacks (PC, STATUS, FSR, W) need to be primed with the desired or appropriate contents, and then a RETI is issued. That then pops the primed shadow contents into the real registers.

There are some other non-trivial issues such as what happens when an interrupt occurred during a SKIP instruction, and what about the M register.

As I stated earlier, in its full implementation there is a fair bit of complexity to this, and is not for beginners .... not to imply that you are a beginner, just a caution.

Cheers,
Peter (pjv)
---------- End of Message ----------

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

2007\01\03@145840 by g_daubachn/a

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

Hello Electronic,
one more note on the secret instructions: These instructions were implemented by the SX designers mostly for supporting on-chip debugging. When you use them, you can't correctly debug your application anymore with the SX-Key, or any other device.

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

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

2007\01\03@190910 by phipin/a

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

Guenther,
One thing I've always wondered about using a port pin, as you describe, to pull /MCLR low: When the port pins are tri-stated, thus releasing /MCLR, is the reset process far enough along at that point to continue reliably without /MCLR having to remain low? Or would a more prudent approach involve driving one of those undervoltage reset chips with a built-in time delay?

I've always used the WDT method to do a software a reset. The WDT should be part of any a well-written SX program anyway. Using it to force a reset is just a bonus! Plus, you can tell at reset that that's what caused it and take, perhaps, a different course of action on restart.

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

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

2007\01\06@053156 by electronicn/a

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

Hi Gunther, Peter (pjv) and the group
You are correct the secret stack instructions popPC/pushPC ($04F/$04B) operate on the interrupt stack.

Sorry for this confusion. I made the silly mistake of programing a single DW byte incorrectly !!!

My program now functions as required.

Many thanks for your valuable help and advice.

Best regards electronic
---------- End of Message ----------

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

2007\01\12@121655 by Sparks-R-Funn/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Sparks-R-Fun wrote:

Hi, all.

  I guess electronic, the originator of this thread, has his program working now which is good.  However, all this talk about secret instructions, etc. has me wondering, "Is it not possible to call other subroutines from within the ISR?"  I am fairly certain I have done this, though I do not remember when.  And if this is possible, would it not solve the whole problem to call a few subroutines that insure the counters are within range before returning from the interrupt?


Maybe I did not follow what was trying to be done.  It just did not seem to me like it should require such a complex solution.

Would anyone care to comment further on this?

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

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

2007\01\12@141218 by Peter Van der Zeen/a

flavicon
face
In SX Microcontrollers, SX/B Compiler and SX-Key Tool, Peter Van der Zee wrote:

Hi Sparks;
Sure, subroutines can be called while in ISR..... the ISR stack is not the same as the subroutine stack, hence there is no interference.

What 'electronic' was asking, could one RETURN (permanently) from an interrupt to a place different  from where the interrupt originated. And the answer is YES, but with some caution and some issues.

Cheers,
Peter (pjv)
---------- End of Message ----------

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

2007\01\13@045427 by electronicn/a

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

Hi Sparks, Peter(pjv) and the group,
I have used the SX interrupt routine for all user interface. On power up the SX jumps to the interrupt routine by RTTC interrupt. All programs are run and program data modified by this interrupt routine. This simple method allows the user selected program to run without the need to waste valuable CPU time checking for user input from the keys.

Best regards
---------- End of Message ----------

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

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