[PIC32M]MicroPython port to the PIC32M
Posted: Fri Nov 08, 2019 3:21 am
MicroPython port to the PIC32M
https://github.com/jacklinquan/micropyt ... rts/pic32m
This is an experimental port of MicroPython to the PIC32M series microcontroller from Microchip. The experiment is done with PIC32MX170F256B in 28-pin DIP package for easy hand soldering.
Supported features include:
REPL (Python prompt) over UART1.
The pyb module with 1 Led and 1 Switch.
I've opened pull request to micropython/micropython to add PIC32M port.
And here's a self-contained MicroPython port to the PIC32M MPLAB project
MicroPython port to the PIC32M MPLAB project
https://github.com/jacklinquan/MicroPython_PIC32M_MPLAB
Some workaround needed to generate genhdr folder manually when you need to configure it differently.
Some brief test result
----------------------
```
MicroPython v1.11 on 2019-11-07; EXPERIMENT with PIC32MX170F256B
>>> a,b=1,2
>>> c=a+b
>>> c
3
>>> 256*256
65536
>>> 100//3
33
>>> import pyb
>>> led=pyb.LED(1)
>>> led.off() # The LED turned off.
>>> led.on() # The LED turned on.
>>> sw=pyb.Switch(1)
>>> sw.value()
True
>>> sw.value() # The switch is pressed.
False
>>> list(5 * x + y for x in range(10) for y in [4, 2, 1])
[4, 2, 1, 9, 7, 6, 14, 12, 11, 19, 17, 16, 24, 22, 21, 29, 27, 26, 34, 32, 31, 39, 37, 36, 44, 42, 41, 49, 47, 46]
>>> import gc
>>> gc.mem_free()
13792
>>> gc.collect()
>>> gc.mem_free()
15392
```
https://github.com/jacklinquan/micropyt ... rts/pic32m
This is an experimental port of MicroPython to the PIC32M series microcontroller from Microchip. The experiment is done with PIC32MX170F256B in 28-pin DIP package for easy hand soldering.
Supported features include:
REPL (Python prompt) over UART1.
The pyb module with 1 Led and 1 Switch.
I've opened pull request to micropython/micropython to add PIC32M port.
And here's a self-contained MicroPython port to the PIC32M MPLAB project
MicroPython port to the PIC32M MPLAB project
https://github.com/jacklinquan/MicroPython_PIC32M_MPLAB
Some workaround needed to generate genhdr folder manually when you need to configure it differently.
Some brief test result
----------------------
```
MicroPython v1.11 on 2019-11-07; EXPERIMENT with PIC32MX170F256B
>>> a,b=1,2
>>> c=a+b
>>> c
3
>>> 256*256
65536
>>> 100//3
33
>>> import pyb
>>> led=pyb.LED(1)
>>> led.off() # The LED turned off.
>>> led.on() # The LED turned on.
>>> sw=pyb.Switch(1)
>>> sw.value()
True
>>> sw.value() # The switch is pressed.
False
>>> list(5 * x + y for x in range(10) for y in [4, 2, 1])
[4, 2, 1, 9, 7, 6, 14, 12, 11, 19, 17, 16, 24, 22, 21, 29, 27, 26, 34, 32, 31, 39, 37, 36, 44, 42, 41, 49, 47, 46]
>>> import gc
>>> gc.mem_free()
13792
>>> gc.collect()
>>> gc.mem_free()
15392
```