Compsetup command emulation

Attempting to run simulation on the following code
Code:
setfreq m16				
dirsB = %11101111			
dirsC = %10111111			
pullup  %00000010			
adcsetup = %0100000001000000	
compsetup  %0101010101, 0	
setintflags %00010000,%00010000
I get a message telling me that
"compsetup is not emulated"
I wonder if I don't have the latest version of the editor.:confused:
 

erco

Senior Member
Which chip? compsetup only works on 28X2 and 40X2.

This mod passes muster in the Editor v5.5 syntax checker:

Code:
#picaxe 40x2
setfreq m16				
dirsB = %11101111			
dirsC = %10111111			
pullup  %00000010			
adcsetup = %0100000001000000	
compsetup  %0101010101, 0	
setintflags %00010000,%00010000
interrupt:
 

AllyCat

Senior Member
Hi,

I wonder if I don't have the latest version of the editor.:confused:
You tell us! But it passes a syntax check in PE5. You have set it to an X2 chip type haven't you?

But perhaps it's a warning that means exactly what it says: that the comparator hardware functionality is not emulated (nor are many of the other silicon hardware/SFR functions) in the simulator (which is primarily intended as a software simulator and not a hardware emulator).

Cheers, Alan.
 
Erco and AllyCat, Thank you for your reply.
I have it setup as a 20X2 and it passes the syntax check on PE v6.0.8.11.
I think Alan's explanation answers my question.
 

hippy

Ex-Staff (retired)
I get a message telling me that
"compsetup is not emulated"
I wonder if I don't have the latest version of the editor.:confused:
You can check the version you have using PE6 Help -> About menu, and there is a "Check for updates" link next to version number shown under the logo on the right.

When I attempt simulation of your code under 6.0.8.11 for 20X2, 28X2 or 40X2 I get "Internal voltage reference for compsetup command is not currently simulated".

Other COMPSETUP settings allow simulation but I did not check if they were doing as would be expected. I would have guessed so and it may only be the particular comparator configuration specified which PE6 cannot simulate.
 
Top