And, for completeness - and others looking for the solution to the actual original topic - the original issue was actually a coding error where
should be
because on X2 parts, if using a symbol within a readadc command, you must use the ADC channel number. For the 28X2 if you type 'readadc b.5' directly the compiler will recognise the mistake and auto-correct the pin name to the channel number (to 'readadc 13)' at compilation, however if you use 'readadc my_symbol' the compiler cannot auto-correct this - hence you must use the correct channel value within the symbol to start with.
So in this case the simulation is trying to simulate 'readadc 5' (because within a symbol B.5 has the value 5) and channel 5 does not exist on the 28X2. On a real chip this wouldn't work either.
Code:
Symbol desired_pot = B.5
Code:
Symbol desired_pot = 13
So in this case the simulation is trying to simulate 'readadc 5' (because within a symbol B.5 has the value 5) and channel 5 does not exist on the 28X2. On a real chip this wouldn't work either.