Simulator vs Program Execution Problem

NoSmoke

Member
I have found what appear to be discrepancies between the Picaxe simulator and program execution on the 14M2 using the serrxd and sertxd instructions.
The differences come in the use of the # option before the variable eg. "serrxd b0" or "serrxd #b0" and "sertxd (b0, 13, 10)" or "sertxd (#b0, 13, 10)".

Experimenting gives the following results:

Simulator:
serrxd bo followed by sertxd (b0) requires ascii input to get a digit output
serrxd #b0 followed by sertxd (#b0) as above
serrxd b0 followed by sertxd (#b0) requires a digit input to get a digit output
serrxd #b0 followed by sertxd (b0) gives a blank output for either ascii or digit input

14M2 program:
serrxd bo followed by sertxd (b0) requires a digit input to get a digit output
serrxd #b0 followed by sertxd (#b0) gives a blank output for either ascii or digit input
serrxd b0 followed by sertxd (#b0) requires a digit in to get an ascii output
serrxd #b0 followed by sertxd (b0) gives a blank output for either ascii or digit input (same as the simulator)

I have also noticed that the simulator "Simulate timeout" (for the serrxd instruction) closes the simulator.

Also, the recovery from a "token timeout" when submitting a post appears to be busted.
 
Last edited:

hippy

Ex-Staff (retired)
Simulator:
serrxd bo followed by sertxd (b0) requires ascii input to get a digit output

14M2 program:
serrxd bo followed by sertxd (b0) requires a digit input to get a digit output
I suspect the difference arises in the way the simulator requires data to be input and how it displays output when the commands are executed than in the operation of the commands themselves. The simulator needs to have characters wrapped in double-quotes to indicate 'this is an ASCII character' whereas for non-simulated use one would simply send the ASCII character.

We will investigate the SERRXD timeout issue.
 

NoSmoke

Member
I see but wouldn't it be better for the simulator and program to behave in the same manner? It caused me a considerable amount of confusion (program debugged and working with the simulator but failed when programmed into the 14M2).
 
Top