Running a parallel lcd display program from a seperate program slot

Captain Haddock

Senior Member
Has anyone tried to run a parallel lcd display program from a seperate program slot (on an x2 chip obviously), I know something like select case would be needed to jump back to the right spot but could it be done?
I was thinking along the lines of save a thread of text to ram and have the second prog slot read it back and display it then jump back to slot 0 with a variable tell it where to goto to continue the prog, I'm guessing jumping from any where in a subroutine would mess things up as the stack would reset.
If it would work would it make it horribly slow?
See, I told you it was a dumb question.....
Not part of any project just being nosey.
 
Last edited by a moderator:

techElder

Well-known member
Well, my initial thought was that the timing of the data being sent to the LCD would be screwed up. However, that might just depend on which LCD you were using and whether you were addressing it serially or parallel.
 

inglewoodpete

Senior Member
I have used mutiple slots in 3 PICAXEs now (in two projects). Being 28X2s and 40X2s, they can be run at the faster speeds (32 & 64MHz), resulting in slot transfer times (overheads) around 1 mS.

I use case structures at the beginning of every slot to pass control to the required routine. In the interests of efficiency, I have found it better to move the larger blocks of code to slots 1, 2 etc. Text output routines to an LCD are generally pretty brief, so I find it best to keep these routines in Slot 0.
 

Captain Haddock

Senior Member
Will you expound on your Case structure comment and how you use that in your programs?
Was just thinking of setting a variable with a value before skipping slot so when it skipped back and started from the beginning case select would read the variable and jump back to the right place, does that make sense?
 

inglewoodpete

Senior Member
I documented what I did in my first multislot program conversion in this post.

My program needed interrupts in multiple slots, so was possibly a bit more complicated than your needs. However, it uses the Select Case statement at the entry point of each slot, which should help you understand the basics of passing control from one slot to another.
 
Top