News:

;) This forum is the property of Proton software developers

Main Menu

Upgrade from proton pic basic

Started by Peter Truman, May 07, 2023, 01:21 AM

Previous topic - Next topic

John Lawton


See_Mos

Re post #15, not as sophisticated as a proper debugging tool but I still find using the RSOut and a simple serial LCD display the easiest way of debugging simple coding.

tumbleweed

#22
Quotetumbleweed, I think 18FxxK50 are sharing the differential pins with the Interrupt On Change, not programming pins. Maybe you meant other USB capable PICs?
I should have been more specific... it's the smaller 20-pin package 18F1xK50 (13K50/14K50) that shares D+/D- with the ICSP pins.

QuoteHmm. lost me there I'm afraid. What simulator and how do I setup a virtual uart? (I'm using Positron Studio)
...So, in order to do this I need a hardware debugger?

To use the hardware debugging you need to use the Microchip tools (programmer/debugger and IDE).

All of the Microchip programmers (PK2/PK3/PK4/ICD3/ICD4/SNAP) can also function as a hardware debugger using the same target connections as used with ICSP programming.
In general, on most modern chips the hardware debuggers don't require any target resources and run at the full-speed of the chip.
They give you full access to all the peripheral registers, breakpoints, single-stepping, etc.
The big advantage is they don't have any of the limitations of debug monitors, P-ICD, or other software-based debug tools which require changing all your code and slow things down.

Microchip has two IDE's... the old MPLAB v8.92 (no longer supported) and the newer MPLABX.
Which one you can use depends on:
- which chip you're using (newer chips are only supported in MPLABX)
- which debug tool (PICKit4 and similar require MPLABX, and MPLABX has dropped support for older tools)
- how much frustration you can tolerate (MPLABX will have you cussing almost immediately)

Each IDE has a simulator built in (which used to be called MPSIM) so you don't have to have one of the programmers to use it.
This is more of a instruction simulator with some basic hardware peripheral support, so don't expect something like Proteus.
Both IDEs include support for a virtual UART, so when you send data out a UART it appears in a window in the IDE.

The old Proton manual used to have a chapter on using it with MPLAB, but either way if you have the compiler generate a .cof file that's all you need for either MPLAB or MPLABX.

Setting all this up and learning to use it isn't the simplest of things so be prepared for a lot of trial and error, especially if you go down the MPLABX path.
The older MPLAB is much simpler.