Axe401 Output Pins mapping

BillyGreen1973

Senior Member
Hi everyone,
I have read the manuals and the axe401 pdf, but can't seem to find the answer to my problem.

I am attempting to use the ArduiNIX Nixie driver shield. (http://arduinix.com/) with the Axe401 Shield Base.
The Arduinix requires the following code to drive it's 2 BCD converter chips, bit0-3 being one chip and bit4-7 being the other.

Code:
#picaxe 28x2
#sim shield

dirsb=%11111111
dirsc=%11111111


main:

	for b1= 0 to 99
	
	let b0=bintobcd b1
	
	pinS.2=bit0
	pinS.3=bit1
	pinS.4=bit2
	pinS.5=bit3
	pinS.6=bit4
	pinS.7=bit5
	pinS.8=bit6
	pinS.9=bit7
	
	pause 500
	
	next b1
goto main
My question is this, is there an easier way of mapping 'b0' onto the pin S.2 to S.9?
Pins S.2 to Pin S.9 span port B and port C and are not in the logical order.
The code above does work but seems a bit 'brute force' and a bit wasteful.
Thanks
 

hippy

Technical Support
Staff member
It's the way I'd do it. You can create a subroutine which moves the 'b0' / 'bit0-bit7' variables out to the shield pins and then just set 'b0' and call the routine to save duplicating the code throughout your program.
 

BillyGreen1973

Senior Member
Thanks Hippy.
Yeah a subroutine would be the way I would go, Just using the code above to make sure things are working as expected.

At least I'm not missing anything dead simple!

I think a 16Mhz resonator for the Axe401 may be in order now though!
 
Top