With the PicoMite running at it's default (125MHz) and a PIC16F1829 (base device for the 20M2) running at 32MHz I programmed as near identical code as I could to output a binary count onto four LEDs on both devices. Having got it working on both I hooked both outputs to the 'scope. Lowest bit output switched at 860Hz on the PicoMite and at 30,000Hz on the PIC. The PIC was running a truly compiled ".asm" program (compiled from BASIC) though I had hoped for something faster from the PicoMite.Just had a prototype board delivered with a PicoMite (well, once I've flashed it...) to assess. Looks interesting if the execution speed of the "code" is fast enough.
As the PIC language had slightly less instructions in its program (offering direct access to the bits in a byte) I added twice as many commands per bit retrieval into the PIC program to compensate, that slowed it from 31,000 down to 30,000Hz.
I should point out there is an IDE for MMBasic. MMEdit. This allows entry of programs on a PC which are then downloaded to the target device in a similar way to PE5 or PE6. There is also a DOS based simulator for code.
Pity it isn't quicker though.
Code:
SetPin GP0, DOut
SetPin GP1, DOut
SetPin GP2, DOut
SetPin GP3, DOut
SetPin GP6, DOut
SetPin GP7, DOut
SetPin GP8, DOut
SetPin GP9, DOut
Dim MyMaster As Integer
Dim MyCounter1 As Integer
Dim MyCounter2 As Integer
Dim MyCounter3 As Integer
Dim MyCounter4 As Integer
Let MyCounter1 = 0
Let MyCounter2 = 0
Let MyCounter3 = 0
Let MyCounter4 = 0
Do
Pin(GP0) = MyCounter1
Pin(GP1) = MyCounter2
Pin(GP2) = MyCounter3
Pin(GP3) = MyCounter4
Pin(GP6) = MyCounter1
Pin(GP7) = MyCounter2
Pin(GP8) = MyCounter3
Pin(GP9) = MyCounter4
'Pause 100 'mS Pause can accept 0.1 (equivalent to 100 uS)
Let MyMaster = MyMaster + 1
Let MyCounter1 = MyMaster
Let MyCounter1 = MyCounter1 And 1
Let MyCounter2 = MyMaster >> 2
Let MyCounter2 = MyCounter2 And 1
Let MyCounter3 = MyMaster >> 3
Let MyCounter3 = MyCounter3 And 1
Let MyCounter4 = MyMaster >> 4
Let MyCounter4 = MyCounter4 And 1
If MyMaster > 31 Then
Let MyMaster = 0
End If
Loop
Last edited: