News:

;) This forum is the property of Proton software developers

Main Menu

Positron Cube

Started by midali, Nov 23, 2026, 09:36 AM

Previous topic - Next topic

midali

Hi all,

I'd like to share PositronCube, a free tool for configuring the newer PIC devices visually and generating ready-to-compile Positron8 BASIC code. You pick a device, click a pin and choose its function: GPIO, ADC, UART, I2C, SPI, PWM or LCD. The tool then writes the fuses, oscillator setup, PPS declares and peripheral initialisation for you.

Supported families (162 devices):

PIC16F: 131xx, 152xx, 153xx, 171xx, 180xx, 183xx, 184xx, 188xx, 191xx
PIC18F: K40, K42, K83, Q10, Q2x, Q4x, Q7x, Q8x

More PIC families will be added in future versions.

Please give it a try and report any bugs you find here: wrong pin, wrong register setting, code that doesn't compile or behaves differently on real hardware. Please include the device name and a short description.

Download: https://1drv.ms/u/c/3801029E3DBF59D0/IQBiTklyIt5gQoUBMb42rqbDAVo-DFZ1ZDe79m3IwUOHs5s?e=waBnFb

Thanks, and enjoy!
DigitAll

midali

PositronCube v1.6 – pin & peripheral configurator for Positron8 / Positron16

PositronCube is a free CubeMX-style tool for Positron BASIC. You pick a PIC, click a pin to set its function, and it generates ready-to-compile code. That code covers the fuses, the oscillator/PLL setup, PPS mapping, GPIO, ADC, UART, I2C (hardware or software), SPI, HPWM and HD44780 LCD.

Supported devices (918):

PIC12F, e.g. 12F675, 12F683, 12F1822
PIC16F classic, enhanced and new PPS families, e.g. 16F628A, 16F877A, 16F1938, 16F18855
PIC18F classic, J, K20/K22/K80 and K40/K42/Q-series
PIC24F/H/E
dsPIC33F/E/EV/CK

I compile-tested every device with Positron, using the internal oscillator, a crystal and a crystal + PLL where available. The tool only offers the features that actually compile on each chip.

Known exceptions:

No HPWM on dsPIC33EP/EV, and no ADIn on dsPIC33CK, because Positron16 doesn't support them there.
No UART/HPWM mapping on a few PIC24/dsPIC33 devices whose Positron .def files have wrong or missing PPS data: 33EP MU/GS, 24FJ GA70x, 24HJ12/16/32.
A few devices are left out because Positron can't build for them or their device data is inconsistent, e.g. 16F1716, 18F2450, 33EP512GM310 and some 44-pin 18F J parts.
The PLL settings for PIC24/dsPIC33 follow the datasheets, but please verify the clock on real hardware.

Please test it with your own devices and report any bugs here. Include the device name and the generated code if possible. If you have ideas for new features, let me know and I'll try to implement them.

Download: PositronCube rev 1.6

DigitAll

Yves

Misali,

Nice little useful setuo program. I will try it in future project. Thank you for sharing

Yves
Yves

BriPSmith

Midali,

Great setup system. Thanks for sharing.

BP
BPS

streborc

This sounds really interesting, but I found Cube won't install on Windows7 Pro, even when I set compatibility mode.  I'm still running Positron on a Windows7 PC primarily because I haven't found a way to disable automatic Windows updates on Windows 10/11 (although I have 2 Win10/11 PCs I could use).  I've tried several registry edits that are supposed to kill the auto updates, but Microsoft insists it owns my PCs because they have Windows installed on them.  The auto updates always restart the PCs, don't restart all the apps that were left open, hose their access to my NAS and I don't trust the auto work-save.


midali

Hi,

Thanks for reporting the Windows 7 problem. It is fixed in v1.12.

Windows 7 support
The desktop build needs Microsoft's WebView2 runtime, which no longer installs on Windows 7. That is why the old installer refused to run there. The v1.12 installer runs on Windows 7 SP1 and picks the right edition by itself:

Windows 10/11 (64-bit): the desktop application, as before.
Windows 7/8 (or 32-bit Windows): the browser edition. It is the same application, and the PositronCube shortcut opens it in your default browser. Firefox ESR 115 or Chrome 109, the last versions for Windows 7, are fine. Saving .bas and .pcube files goes through the browser's download.


What's new since v1.6

Interrupts for the 8-bit PICs (PIC12F, PIC16F and PIC18F):
periodic interrupts on Timer0, Timer1 and Timer2;
the external INT0 interrupt;
a UART receive ring buffer.

The code uses On_Hardware_Interrupt with Context Save/Restore. The interrupt bit names come from each device's .def file. Timer1 and Timer2 periodic interrupts work on all PIC18F, with both the old (T2CON/PR2) and the new (T2CLKCON/T2PR) timer registers. Interrupts are not available yet for PIC24/dsPIC33.

Please note: interrupt support is new and has only been compile-tested, not checked on real hardware for every device. The interrupt configuration may still contain errors on some parts, so please check the generated setup against the datasheet. I'd be glad to hear about any problems you find.

Stand-alone PWM modules (PWM3, PWM4, ...), set up directly in the registers, independent of HPWM:
10-bit PWMn on PIC12F/16F/18F (e.g. 16F15223, 16F1509, 16F18855, 18F27Q10, 18F27K42). They are clocked by Timer2, or by Timer4/Timer6 on devices that can select them, so two different PWM frequencies are possible.
16-bit PWMn with two outputs on 18F Q2x/Q4x/Q7x/Q8x and 16F171xx.
PPS pins are mapped where the device has PPS. Fixed pins are used on the others.
PWMn_Duty() procedures are generated so you can change the duty cycle at run time.
The 16-bit PWM on 16F157x is not supported yet.
Selectable internal oscillator frequency on the 16F152xx/16F180xx parts (1, 2, 4, 8, 16 or 32 MHz), e.g. 4 MHz on the 16F15223.
When the clock frequency changes, the UART baud rate is adjusted automatically if the selected one is no longer achievable.

All generated configurations were compile-tested with Positron on all the supported devices.


Regards,
DigitAll

Download : PositronCube v1.12


▲