I need help using MPLAB X IDE V3.55, I found a good step by step video but it uses V1.90 and after about 10 steps it diverges from my version and I can't find the next step on my version (V3.55) which I hope is the latest version. I am using PICKit3 and have it wired correctly to the target chip with power and 20Mhz xtal.(and 10K resistor /MCLR to Vdd)
I just want to load my hex file to my chip (18F26K20) and be able to run/debug.
I can compile without errors for a hex file using GCB. But using MPLAB blows my mind, to many variables.
I just want to set chip type, load the hex program and start debug.
I have the instruction for using debug so that shouldn't be a problem. It is loading the hex file and starting debug that I am stuck .
Any suggestions or sources such as video
///
Sxcreen shot of my current MPLAB X IDE V3.55 below
I hear you and know your pain, I hate MPLabX, that is the main reason I found GCBasic, I was looking for an alternative IDE and found a great programing language.
I can't take you step by step through the IDE but I can save you the pain by pointing out that what you need is not the IDE but the IPE.
In Windows go to Start-> All Programs-> Microchip-> MPLAB IPE 3.35
in your case it may be 3.55.
That is the standalone programming tool for the PICKit 3 - It will allow you to open the Hex File that was created by GCBasic and Program your device via the PICKit without loading the whole of MPLAB X.
Cheers
Chris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Before delving into the world of MPLABX debugging, I suggest you set up your <flashPic.bat> file so that you can easily program the GCB created hex file into your PIC. Write some simple programs, or load up some of the demos and program your PIC using Great Cow Basic.
I prefer to use MPLABX IPE command line (IPECMD.EXE) for programming from the GCB IDE as it correctly supports nearly ALL PIC Chips. Others still prefer to use the older and now depricated PK3GUI that relies on the PK2 Device files. Some still use the Pickit2 command line ( also depricated and no longer supported by Microchip).
Why you would want to jump into MPLABX debugging now, eludes me. It is not easy and is not necessary for 99.9% of the programs you will write with Great Cow Basic. I think most GCB users debug on the chip and use either a serial terminal app to display register settings or an LCD Display. ( I generally use a 4x20 LCD). In 4 years I think I have used MPLAB once for debugging.
So please let us know why you want to jump into MPLAX IDE (Debugger) so soon ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Attached is my flashPic.bat file that uses MPLABX 3.55 IPECMD.exe . You can replace your existing flashPic.bat with this file. It will work well as is, unless you installed MPLABX in other than the default location. In that case you must change the active line to reflect the actual file path. If you did not install IPE when you installed MPLABX IDE, you must reinstall MPLABX and check IPE.
With this new flashPic.bat and with IPE installed and the Pikit3 properly connected to the PIC you can now program directly from the Great Cow Basic IDE by clicking on Flash/Hex.
I highly recommend NOT powering the PIC from the Pickit3. The PK3 cannot supply much current and it will never reach 5.0V unless the USB VBUS is > 5.6 volts or so ( Unlikely). So connect an external 5.0V source to your breadboard or dev board for starters.
Thanks William, I will try that also. Just using the program loader as suggested above I get this msg.
* Connecting to MPLAB PICkit 3...
Currently loaded firmware on PICkit 3
Firmware Suite Version.....01.47.12
Firmware type..............PIC18F
Target voltage detected
Target Device ID (0x0) is an Invalid Device ID. Please check your connections to the Target Device.
*
Tried a new chip but the same, checked wiring and resistor so many times and no wirring error. I have a 20 mhz xtal installed but scope shows no osc running. ( I have a kit board with the same chip and the same xtal, osc runs fine without loading caps). I have ordered cihips with internal osc (18F14K22 and 16F866) and will try those using sample program from GCB (led flasher).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
William, exactly how my BB is setup as per your BB picture, just using a 18F26K20 insead, minus the reset button and minus the LCD header (on order).
Adding the rest button right now !
.
Last edit: Paul Haug 2017-03-08
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If the Target voltage is detected and IPE reports an ID of "0" it usually because.
The PIC has no power. Either the PIC ground or Vdd is bad. Measure the voltage directly across Pins 20 & 19 and Pins 20 and 8 on the chip. Should be = Vdd. Measure this with the Pickit 3 disconnected from the breadboard.
.
The PGC & PGD lines are reversed or on the wrong pins. ( easy to do) .
The 10K resistor on Pin1 is tied to ground instead of Vdd..Make sure is tied to Vdd (+5)
There is something other than Pickit 3 connected to PGC or PGD pins.
Last edit: William Roth 2017-03-08
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Found my main problem, cheap Chinese power supply leads were crappy, made up good supply leads and now downloads work. Still no run but that may have to do with the xtal which I have installed (20 Mhz) but don't have the 20pf loading caps yet. . Somewhere in Micochip data sheet for 18F26K20 I thought it stated it also has internal osc, so will play around with #config osc stuff.
Other wise should be getting some chips with internal osc such as 14K22 and 16F866.
;
Again, many thanks to all you great programmers for your help and I will abandon MPLAB X IDE for awhile and just use a terminal or LCD as suggested.
Paul
Last edit: Paul Haug 2017-03-08
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Now you have access to all the features of your microcontroller, All timers, all peripherals, No memory "slots" to mess with ...The list goes on, Oh, and executng a command takes 1 or 2 microsecond (or less) instead of 100 or 200 microseconds.
And you are not limited to just a few chips. GCB supports nearly ALL PIC 8-bit microcontrollers as well as most AVR 8-bit microcontrollers.
And don't forget the Demos. They are an excellent resource in helping youi learn GCB.
William
Last edit: William Roth 2017-03-09
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have the USART working at 9600 baud, but my pic is a 3.3V chip, although I have run it 5V but I am sure it is stresing it.
Since my LCD will run at only 5V (tried at 3.3V, nothing) I need to add a single transistor to translate the signal to 5V, but that will invert the signal. Is there a way to invert the signal at the microchip. Here is my test code.
Also what is SCKP = 0 for r do. This was from one of the sample codes
;
#chip 18f26k20
;NO VALUE AFTER 18F26K20 GIVES VERY CLOSE TO 9600 BAUD
; ----- Define Hardware settings
' THIS CONFIG OF THE SERIAL PORT TO A LCD UART
' USART settings
#DEFINE EXPLICIT
#define USART_BAUD_RATE 9600
Dir PORTc.6 Out
Dir PORTc.7 In
; #define USART_DELAY 5 ms
; #define USART_BLOCKING
SCKP = 0
; ----- Variables
' No Variables specified in this example. All byte variables are defined upon use.
; ----- Main body of program commences here.
; HserPrint 0xFE ;turn on baclight
wait 1500 ms
do Forever
HSerPrint "Hello World"
' "Carriage Return"
HSerSend 13
' "Line Feed"
HSerSend 10
; need long delay here to msg
wait 2000 ms
Loop
Last edit: Paul Haug 2017-03-10
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Level shifting does not always mean the signal will must be inverted. There is more than 1 way to skin a cat. The attached circut will level shift from 3.3V to 5V without inverting the signa. I used a general purpose NPN transitor, but a 2N7000 will work even better.
Again thanks William and Anobium. The level shifter single transistor circuit is great. Been retired to many years from discret circuit desin and forgot that one. Hope to have 5V PICs today or tommarow but will put that CKTXP in my notes for future use aso.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I need help using MPLAB X IDE V3.55, I found a good step by step video but it uses V1.90 and after about 10 steps it diverges from my version and I can't find the next step on my version (V3.55) which I hope is the latest version. I am using PICKit3 and have it wired correctly to the target chip with power and 20Mhz xtal.(and 10K resistor /MCLR to Vdd)
I just want to load my hex file to my chip (18F26K20) and be able to run/debug.
I can compile without errors for a hex file using GCB. But using MPLAB blows my mind, to many variables.
I just want to set chip type, load the hex program and start debug.
I have the instruction for using debug so that shouldn't be a problem. It is loading the hex file and starting debug that I am stuck .
Any suggestions or sources such as video
///
Sxcreen shot of my current MPLAB X IDE V3.55 below
Last edit: Paul Haug 2017-03-08
Hi Paul,
I hear you and know your pain, I hate MPLabX, that is the main reason I found GCBasic, I was looking for an alternative IDE and found a great programing language.
I can't take you step by step through the IDE but I can save you the pain by pointing out that what you need is not the IDE but the IPE.
In Windows go to Start-> All Programs-> Microchip-> MPLAB IPE 3.35
in your case it may be 3.55.
That is the standalone programming tool for the PICKit 3 - It will allow you to open the Hex File that was created by GCBasic and Program your device via the PICKit without loading the whole of MPLAB X.
Cheers
Chris
Before delving into the world of MPLABX debugging, I suggest you set up your <flashPic.bat> file so that you can easily program the GCB created hex file into your PIC. Write some simple programs, or load up some of the demos and program your PIC using Great Cow Basic.
I prefer to use MPLABX IPE command line (IPECMD.EXE) for programming from the GCB IDE as it correctly supports nearly ALL PIC Chips. Others still prefer to use the older and now depricated PK3GUI that relies on the PK2 Device files. Some still use the Pickit2 command line ( also depricated and no longer supported by Microchip).
Why you would want to jump into MPLABX debugging now, eludes me. It is not easy and is not necessary for 99.9% of the programs you will write with Great Cow Basic. I think most GCB users debug on the chip and use either a serial terminal app to display register settings or an LCD Display. ( I generally use a 4x20 LCD). In 4 years I think I have used MPLAB once for debugging.
So please let us know why you want to jump into MPLAX IDE (Debugger) so soon ?
Thanks Chris, I used that earlier but didn't see any way to run a debu, did I miss somethin, or is just a programmer ?'
Thanks William, I will try what you suggest.
Attached is my flashPic.bat file that uses MPLABX 3.55 IPECMD.exe . You can replace your existing flashPic.bat with this file. It will work well as is, unless you installed MPLABX in other than the default location. In that case you must change the active line to reflect the actual file path. If you did not install IPE when you installed MPLABX IDE, you must reinstall MPLABX and check IPE.
With this new flashPic.bat and with IPE installed and the Pikit3 properly connected to the PIC you can now program directly from the Great Cow Basic IDE by clicking on Flash/Hex.
I highly recommend NOT powering the PIC from the Pickit3. The PK3 cannot supply much current and it will never reach 5.0V unless the USB VBUS is > 5.6 volts or so ( Unlikely). So connect an external 5.0V source to your breadboard or dev board for starters.
Here is sonething I did quite a while back to show how to set up a breadboard for programming a 28-Pin PIC with Pickit3.
Thanks William, I will try that also. Just using the program loader as suggested above I get this msg.
* Connecting to MPLAB PICkit 3...
William, exactly how my BB is setup as per your BB picture, just using a 18F26K20 insead, minus the reset button and minus the LCD header (on order).
Adding the rest button right now !
.
Last edit: Paul Haug 2017-03-08
If the Target voltage is detected and IPE reports an ID of "0" it usually because.
.
The PGC & PGD lines are reversed or on the wrong pins. ( easy to do) .
The 10K resistor on Pin1 is tied to ground instead of Vdd..Make sure is tied to Vdd (+5)
There is something other than Pickit 3 connected to PGC or PGD pins.
Last edit: William Roth 2017-03-08
Found my main problem, cheap Chinese power supply leads were crappy, made up good supply leads and now downloads work. Still no run but that may have to do with the xtal which I have installed (20 Mhz) but don't have the 20pf loading caps yet. . Somewhere in Micochip data sheet for 18F26K20 I thought it stated it also has internal osc, so will play around with #config osc stuff.
Other wise should be getting some chips with internal osc such as 14K22 and 16F866.
;
Again, many thanks to all you great programmers for your help and I will abandon MPLAB X IDE for awhile and just use a terminal or LCD as suggested.
Paul
Last edit: Paul Haug 2017-03-08
Hot diggitry dog, it is working on internal osc, running the simple led flasher.
IT'S ALVE, IT'S ALIVE !!!!!
Last edit: Paul Haug 2017-03-09
That's good news Paul. You have done well.
Welcome to the world of Great Cow Basic!
Now you have access to all the features of your microcontroller, All timers, all peripherals, No memory "slots" to mess with ...The list goes on, Oh, and executng a command takes 1 or 2 microsecond (or less) instead of 100 or 200 microseconds.
And you are not limited to just a few chips. GCB supports nearly ALL PIC 8-bit microcontrollers as well as most AVR 8-bit microcontrollers.
And don't forget the Demos. They are an excellent resource in helping youi learn GCB.
William
Last edit: William Roth 2017-03-09
I have the USART working at 9600 baud, but my pic is a 3.3V chip, although I have run it 5V but I am sure it is stresing it.
Since my LCD will run at only 5V (tried at 3.3V, nothing) I need to add a single transistor to translate the signal to 5V, but that will invert the signal. Is there a way to invert the signal at the microchip. Here is my test code.
Also what is SCKP = 0 for r do. This was from one of the sample codes
;
Last edit: Paul Haug 2017-03-10
Paul,
The Hardware Hsersend signal can be inverted by setting the CKTXP Bit of the Baudcon Register
Add this line to your code
See PIC18F26K20 Datasheet Page 233
Also, see your installed demos. This shows the CKTXP and the receive option.
..\GCB@Syn\GreatCowBasic\Demos\Serial Communications Solutions\Hardware Serial LoopBack Solutions\HardUART_18f14k50.gcb
Level shifting does not always mean the signal will must be inverted. There is more than 1 way to skin a cat. The attached circut will level shift from 3.3V to 5V without inverting the signa. I used a general purpose NPN transitor, but a 2N7000 will work even better.
Again thanks William and Anobium. The level shifter single transistor circuit is great. Been retired to many years from discret circuit desin and forgot that one. Hope to have 5V PICs today or tommarow but will put that CKTXP in my notes for future use aso.