Simulator issue

Technoman

Senior Member
#1
Win 10 - PE6 6.1.0.0

Hi,

1) As I was testing a simple program (blockly) for a 20M2, as included, there was no sign of change on pins during simulation.
If I'm setting up any pin before the loop then it works fine, but only for this pin. Why?

2) I needed to get it run also on a board fitted with 20M. After switching between 20M2 and 20M, port B is renamed within the blocks to port C (?), but the simulation is correctly working on port B. Why? See file included.
 

Attachments

hippy

Technical Support
Staff member
#2
For (1) You are issuing pinsB= commands, but you haven't set the direction for those port B pins, so they remain inputs, aren't affected by the pinsB= because they are not outputs.

(2) Not quite sure. Could be a 'good old fashioned bug'. If a new 20M program is created things are correct, so probably some odd issue when changing the program to use a different PICAXE.
 

Technoman

Senior Member
#3
I missed that. It's now working although, after conversion, once, the basic program shows let dirsB as a comment...

Is it the same for high and low as it usually works without setting direction?

Converted program.PNG
 

hippy

Technical Support
Staff member
#4
I missed that. It's now working although, after conversion, once, the basic program shows let dirsB as a comment...
Are you sure that the PICAXE type selected in workspace explorer is set to 20M2, hasn't been left as 20M ?

I think you have a "20M2" program which is actually set for using a 20M. That's the mistake I made when I got the same results as you did. With the correct PICAXE type selected it works as expected.

Is it the same for high and low as it usually works without setting direction?
HIGH and LOW automatically set direction because they work on single pins. But pinsB= doesn't set direction because it's never certain with any pinsB= which of the pins are actually used as outputs.
 

Technoman

Senior Member
#5
Thanks. Before the recent retrofitting of our robots with 20M2, we used to program 20M for years, a chip which was not as versatile.
 
Top