Effect of loop back to start versus a harware reset
Posted: Thu Oct 19, 2006 12:55 pm
I have a problem that my Flowcode 2.2. programme runs fine but that it will not β€restart’ by looping back to the start and function properly.
The programme is basically
Initialise variables
Clear arrays
Start timer 0 interrupt driven clock
RS232 input of acquisition parameters from PC
Loop to acquire data
RS232 output to PC of data
End
This works fine.
If I carry out a hardware chip reset the code will function again without any problem.
BUT
If I loop from End to the first line again the programme restarts OK (welcome message on LCD etc)
But the RS232 input will just not work (but recall that it does work from a hard reset), i.e. :
-A:
Initialise variables
Clear arrays
Start timer 0 clock
RS232 input of acquisition parameters
Loop to acquire data
RS232 output of data
Goto-A
End
The RS232 input and output routines use handshaking by exchange of characters, hardware handshaking is disabled (as you previously advised).
All is run on v3 Dev Board with RS232 E-block, but also runs the same on a self-made dedicated circuit.
So three questions please :
1) What will be different between the hard reset and loop back to start of chart?
2) How can I simulate a hard reset through software? "asm goto 0β€ ?
(if so, correct syntax please).
3) Does Flowcode keep a buffer of β€unread’ inputs in the PIC (the PC can but I have bottomed that).
The programme is now up to nearly 4k so picking through the assembler is beyond me now.
Many thanks,
The programme is basically
Initialise variables
Clear arrays
Start timer 0 interrupt driven clock
RS232 input of acquisition parameters from PC
Loop to acquire data
RS232 output to PC of data
End
This works fine.
If I carry out a hardware chip reset the code will function again without any problem.
BUT
If I loop from End to the first line again the programme restarts OK (welcome message on LCD etc)
But the RS232 input will just not work (but recall that it does work from a hard reset), i.e. :
-A:
Initialise variables
Clear arrays
Start timer 0 clock
RS232 input of acquisition parameters
Loop to acquire data
RS232 output of data
Goto-A
End
The RS232 input and output routines use handshaking by exchange of characters, hardware handshaking is disabled (as you previously advised).
All is run on v3 Dev Board with RS232 E-block, but also runs the same on a self-made dedicated circuit.
So three questions please :
1) What will be different between the hard reset and loop back to start of chart?
2) How can I simulate a hard reset through software? "asm goto 0β€ ?
(if so, correct syntax please).
3) Does Flowcode keep a buffer of β€unread’ inputs in the PIC (the PC can but I have bottomed that).
The programme is now up to nearly 4k so picking through the assembler is beyond me now.
Many thanks,