There are many that are joining us. I hope you find us friendly and supportive.
There are a number of exPixace users, I am one... a while ago, but there are many that will answer your questions and queries. Don't ever struggle - just ask.
:-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Of the products you mention the only one I know is Micromite, and that is one I still use.
I got here looking for an alternative to MPLABX as an IDE and found not only a better IDE but a better compiler and a great bunch of people.
Welcome aboard, we look forward to working with you.
Cheers
Chris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Welcome Johan. I came from picaxe also, so I can help as well.
ps. for a fast start...use a uno...nice board with sockets,psu,leds.
just plug the usb in, change the ide avr tools to uno and the com port it uses and you're away. SO easy and the uno 328p is capable.
Last edit: stan cartwright 2017-11-16
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I guess for the most of you it is hard to remember your first steps in GCBasic, but for me it was only yesterday...
If there are any fresh starters behind me, you can save yourself the time that I spoiled. I'll try to describe my obstacle run
Before I started I figured it will probably be easy, because I didn't find any posts related starting-up trouble. Now on hindsight I know creating the first "Hello world" is indeed easy but it took me some head scratches before reaching that point.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Please do share because any user experience, especially bad experience, is useful to help us in creating the help files, getting started guides and tutorials.
Even if the bad experience was not with GCBAIC it still highlights pitfalls we should avoid.
The hardest part of getting started in GCBASIC is accepting that it really is easy, I think I spent days trying to work out what I was missing because:
PART 1, WHERE TO START
It all started a week earlier when I was looking around to where to start. So I found (http://gcbasic.sourceforge.net/starting.html) "Getting Started with Great Cow BASIC". The headscratching began.
Reading the text made it clear to me that I should find an IDE to work in, because it says "Great Cow BASIC is now usable. You can drag the file that you want compiled on to "gcbasic.exe", ..... If you don't like compiling things this way, you can install an IDE"
Ok, so that's clear, I have to install an IDE. The tutor gives 3 optional IDE's: GCB@Syn, Crimson Editor or GCBIDE. I later found that this GCBIDE has nothing to do with the Great Cow Basic IDE which made it even more confusing. So I read all I could about these IDE's but couldn't find a good reason for one above the other.
Ok, let's put that problem aside for later.
Now I was advised to install a Programmer "...to actually do something with the files you compiled". Yes lets do that, because programming the real chip is what it's all about, isn't it? Now 2 options are explained, IC-Prog and WinPic. Again, I read as much as I could about these programs, because I still didn't know what this programmer is for. For the second option, WinPic, I should install MPLAB. So I read about MPLAB. I understood that is has an IDE also (number 4?) and a tool to directly program a PIC MPLAB-IPE. I thought that was what I was going to need.
Today I know there was no reason to worry because it all proved to be very easy. But at the moment I was getting a little desperate. How hard is it going to be to flash a LED?
I finally decided to just start and see what happens, so I went to the download page. Option 1 "Great Cow Basic IDE" was not really about downloading just the IDE but in fact had ALL programs that I needed for my "Hello world"! If I had only taken this step before spoiling days of reading.... life would have been a lot easier.
I was getting anctious now. I had the Pickit3 in the mail that I ordered from Farnell so I was ready to go!
Last edit: JohanDenRidder 2017-11-17
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you. These insights do help. I have just redirected /starting.html to the new website. The information on the old page must have been very confusing. It any one wants to re-write and provide us a new replacement GettingStarted page then please sent through - this would be most helpful.
:-)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I started gcb using a uno with no programmer. There's a boot loader built in like picaxe.
I then reprogrammed my 28x2 picaxe chips with gcb using #chip 18f28k22 which is what they are and using pickit2 and in circuit serial programming no prob. That would be like picaxe programming but different pins for rx/tx. gcb uses microchip pins.
I would again suggest a uno which is like a picaxe 28x2. So easy to get running. Less than a fiver and an acrylic case for 2 quid. plug n play.
Anyway there's lots of ways and you'll get help here.
What did you do with picaxe? Looking at turning a led on off picaxe example and then gcb example and see the different key words for port, port direction, port on, port off. That's where to start, syntax differences, not many. GCB is less complicated and more basic than picaxe basic I found.
What board/pic you going to use?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I used picaxe for very different projects. From automating a coffee machine to a smart home heating thermostat to a spindle speed controller for a CNC lathe.
I guess you are about my age so you know that back in the old days, before the microcontroller era, we only used discrete electronics components. I waited a long time before to join the new style of development with microcontrollers. I started with picaxe a few years ago wich opened a new way of thinking when developing. Obviously the system has its limits but still I had a lot of fun with it.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
PART 2, INSTALLING THE SOFTWARE
I first installed the software from Microchip "PICkit3 Programmer Application Setup" as I read somewhere that this was an easy tool to program a pic. Again, it took me a long time to find it in the archives of Microchip only to discover later that it was also in the "Great Cow Basic IDE" download. I could have saved me the trouble.
Trouble came nonetheless. After starting C:\Program Files (x86)\Microchip\PICkit 3 v3\PICkit3.exe it was impossible the exit the program. I had to use the taskmanager to stop the program each time. I found the cause of it. Since Windows 7 software developers are not alowed anymore to let their program write anything in the C:\Program Files path anymore. I solved this problem by temporarely copying the complete program to my desktop. Exiting the running program from here works fine. Now you can see a file "PICkit3.ini" has been created. You need to go into the properties of this file, to the security tab. Here you give the file all rights to read and write. Copy this file to the original path in C:\programs and from now on you will be able to close the program normally.
Ok, first hurdle taken.
Now I starting PICkit3.exe with the PICkit3 programmer connected to an USB port only to find that the programmer didn't work yet. I can't remember the error code but is was something like "no operating system found". I had no idea but I tried Tools > Download PICkit Operating System anyway and chose the file C:\Program Files (x86)\Microchip\PICkit 3 v3\PK3OSV020005.hex as it was the only one starting with PK3OS... PICkit3 was now found by the software so I was getting more confident about the project.
Next, installing the downloaded "Great Cow Basic IDE". This was as easy as ticking all boxes and click Install. That's it.
After starting GCB an IDE presented itself so I needed no more worrying about that either.
Now over to the hardware...
Last edit: JohanDenRidder 2017-11-17
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I still like, and use PicAxe, but use it significantly less now I can use 'real' PICs. I say that mostly because I am able to take advantage of the much lower pricing, much higher speeds and much greater memory in comparison to PicAxe.
What I do miss enormously about PicAxe is the much quicker development time. The PicAxe IDE with it's built in fully featured simulator is just wonderful and a great time saver for me. I wish I was in a position to justify the costs of Proteus which offers full simulation of the PICs I mainly use (16F1825/1829) that is almost (probably better actually) as good as the PicAxe one. I have looked at SimulIDE but failed to get anything to work at all, and at the time I looked at it I don't think it supported the 16F1825/1829 chips.
Welcome, and good luck.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am getting along experimenting now and started to feel the same thing. The PICaxe simulator seems like water to a fish; you'll miss it once you don't have it anymore...:)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
PART 3, HARDWARE
Hooking up the PICkit3 to a PIC required some head scratching again.
As usual, I read a lot (too much?) about the subject. I watched a Youtube video that used an "Xpress Evaluation Board" but I couldn't understand how it worked. With just a USB connection maybe it used a serial programming technique like Picaxe or would the board have an on-board hardware programmer?
For now all I wanted is to find the simplest way to flash a LED.
So I connected the PICkit3 with 5 wires to a breadboard with a PIC12F1840 on it. I checked the Microchip poster that came with the programmer. New confusion! On the poster it said that the PIC Vpp/MCLR must be connected with a 50kOhm resistor to Vdd. Why is wasn't 47kOhm I don't know, it might mean that the value is important. Reading up upon the issue made it even more confusing because all other sources mentioned 4.7k to 10k, even on the Microchip website.
I put in a 47k resistor and later even left it out just for trying. I worked just as well.
Next issue that I couldn't wrap my head around was the power supply. The Microchip poster had an image showing the connections. What I didn't understand was the power connection between the PICkit3 and the target (my breadboard with PIC12F1840). The strange thing was that the PIC Vdd +5V was connected to the PICkit3 output that had also +5V Vdd. So either the PIC or the PICkit should be powered. Not both at the same time because I shouldn't short circuit the power output of the PICkit to the power supply of the PIC, should I?
Apparently I was wrong again but all info on the Microchip poster said I should power the target (PIC). The poster showed on the target (PIC) side an arrow from Vdd pointing upwards so I figured I had to power the PIC which would then power the PICkit3. The schematics added to that misunderstanding: In the drawing of the programmer it says literally: "Target Vdd is used to power the IO drivers in PICkit3". Also, the "Recommended settings" said: "Power supplied by target". Needless to say that this didn't work? So don't let the drawings fool you; the power connection of the PICkit (pin2) is an power output only, you cannot power the PICkit with it.
Ok, so what then? It leaves nothing else then to power up the PICkit with the USB cable. I didn't connect a power supply to the PIC because I didn't want to fry anything. So without power to the PIC programming started. It worked, it seemed like the hex code flowed to the PIC! Now I had to power up the PIC to see the LED flash. It did. My first success on a blank PIC. On the next try, when sending a new hex file to the PIC, I forgot to disconnect the PIC power supply. Nothing exploded! In fact, PICkit3.exe showed a message like "external power detected". Ah, ok. So I was making a lot of trouble about nothing. If the PIC is not powered the PICkit takes care of it. On the other hand if it is powered, PICkit will sense that and doesn't supply power to the PIC. No harm done. Why did I go through all this trouble? I cost me the best of a day trying to figure it all out on forehand.
Now how did I get the HEX in the PIC?
From "C:\GCB@Syn\GreatCowBasic\Demos\LED Solutions\LED - Simple PulseOut" I took "BlinkLED using PulseOut 16F886". It looked like this:
chip 16F886, 16
Do Forever
PulseOut PORTB.5, 500 ms
Wait 500 ms
Loop
I changed the first line to "#chip 12F1840", "PORTB.5" to "PORTA.2" and pressed F5 (F5 being a lucky shot because I used to do that in Visual Basic). PICkit3.exe started but raised an error "Device file PK2DeviceFile.dat not found. Must be in same directory as executable". Couldn't solve that problem so I looked further and found F6 to compile without flashing. This worked.
By then I still had no idea that my next step would be successful. I started PICkit3.exe and clicked "Auto Import Hex + Write Device". I browsed to the path where I expected the hex file to be and clicked on it. Right away programming of the PIC started. That easy!
Later I found that if I left open the Auto Import function, things were even more easy. I could edit a basic program and press F6 to program the PIC real time. PICkit3.exe kept polling the last used file name so each press of F6 did the complete sequence of compiling to hex, importing to PICkit3.exe and programming the PIC.
One cick, as simple as Picaxe, so to say.
Ok, I finally had my flashing LED. In the end I found myself with a minimal setup: only a PICkit3 programmer and the GCB download package. That's it!
No extra hardware in the form of boards or Arduino's, no extra software like IDE's or MPLAB or any other utility. Just a PIC on a breadboard with no extra components and a PICkit. This really was what I was after.
Maybe you are a lot smarter than me, in which case you are not going to waist as much time as I did. For other novices I hope my experience may be of help to you.
That is a great story Johan, and one that I am sure many of will sympathise with.
You mentioned the Xpress Evaluation Board and that is Microchips answer to what you experienced.
It is literally just plug and play in Linux, Windows and IOS.
You noticed it appeared as a com: Port on the PC but that is not a bootloader as you surmised, it is a USB/Serial Bridge similar to an FTDI deviceand is provided only for your convenience. The actual programmer appears as a Drive Letter.
The one I currently have hooked up appears in file explorer as XPRESS (F:).
No drivers required, no fancy power supplies or current limiting resistors.
Just copy the Hex file to Drive F: and you have programmed your PIC.
There's not much we can do about the Microchip documentation but we can certainly improve the GCBasic Documentation. It had slipped hopelessly out of date and, as we were all seasoned users, we never noticed.
Thanks for the inspiration to tackle the task.
Cheers
Chris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I didn't know that Chris cos I haven't got a xpress board. You mean you plug it into win usb and it comes up as a mass storage device? Amazing.
Not much of a pic though or am I missing something? I use 18f25k22's for most dev. mega328 is good for most stuff too but I only use gcb, no mplab stuff. The only microchip program I used was mpasm.exe for assembler once.
Clone Uno board £3.90 buy 3 instead :) ... sorry, I like them. and the fake chips socketed.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes it appears as a mass storage device on Win, Linux and MacOS, and if you think it is not much of a PIC you certainly are missing something.
It is one of the new enhanced Mid range Core devices, with device independent peripherals.
If you look at the Pinout diagram hardly any peripheral pins are indicated, not because it is devoid of them, but because it has so many there are not enough pins to even start to accommodate them.
The solution is PPS (Peripheral Pin Select) which not only lets you decide what peripherals you want to use, but what Pins you want to allocate them to.
Amongst the many onboard peripherals are:
4 x Configurable logic cells - think PLA (Programmable Logic Array) capability.
A Numerically Controlled Oscillator - think DDS waveform generation.
ADC with computation - They do there own math and leave the core to do other things.
Digital to Analog converter
Data Signal Modulator want to encode Gray Code on the fly, or maybe drive a radio transmitter?
Zero Cross Detect so you can synchronize to an external waveform, say the mains frequency.
And that is above and beyond all the normal peripherals you expect in a high end PIC, like 2x SPI ports and 2x I2C channels. 1KB of RAM and 256 Bytes of EEProm...........
The list goes on.
The only device that currently tops it is the PIC16F18877 which is the same core but in a 40 pin package with 4KB of ram.
Take a look stan, at $12 it may cost the price of several clone Arduinos, but it has considerably more bang for the buck and is an excellent learning tool as you have all those peripherals to experiment with in a small and comfortable package that requires no external programer, bootloader or FTDI device, they are built in already.
Cheers
Chris
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I only checked it briefly. I've seen the chip for £2. Maybe I'll share your enthusiasm if I got one.
32K flash but can address 64K. Please explain the point.
32MHz. Am I right 18Fxxxxx are/can be 64MHz and faster is better? Or we'd be using old 4MHz pics.
Does it run code faster than older pics same clock speed?
4 x Configurable logic cells - think PLA (Programmable Logic Array) capability.
Think sloppy pcb design-dim problemo, you can fix it later :)
A Numerically Controlled Oscillator - think DDS waveform generation.
square wave or sine?
ADC with computation - They do there own math and leave the core to do other things.
what computation?
Digital to Analog converter
Data Signal Modulator want to encode Gray Code on the fly, or maybe drive a radio transmitter?
Zero Cross Detect so you can synchronize to an external waveform, say the mains frequency.
no one uses the mains frequency any more do they? except for ac motors.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
And do yourself a favour, get the Xpress Development board, not just the chip. The Programmer and USB/Serial converter are worth it and the MikroBUS offers as many perephirals as the Arduino Shields but without the wierd footprint. Much greater portability.
Hello forum, new user here.
Coming from Picaxe I was looking for the next step some time now.
Beside GCB I considered Micromite, ZBasic, Bypic, Oshon Basic, XCSB basic and MicroBasic before eventually deciding that GCB must be the way to go.
Happy that I got things working now I wondered if it is of interest for other newbies to know about the route I took and the obstacles I met?
Anyway, I am really exited with the first steps I took. GCB looks very promising and a whole lot faster then what I am coming from.
Regards,
Johan
Welcome to Great Cow BASIC.
There are many that are joining us. I hope you find us friendly and supportive.
There are a number of exPixace users, I am one... a while ago, but there are many that will answer your questions and queries. Don't ever struggle - just ask.
:-)
Hi Johan,
Of the products you mention the only one I know is Micromite, and that is one I still use.
I got here looking for an alternative to MPLABX as an IDE and found not only a better IDE but a better compiler and a great bunch of people.
Welcome aboard, we look forward to working with you.
Cheers
Chris
Welcome Johan. I came from picaxe also, so I can help as well.
ps. for a fast start...use a uno...nice board with sockets,psu,leds.
just plug the usb in, change the ide avr tools to uno and the com port it uses and you're away. SO easy and the uno 328p is capable.
Last edit: stan cartwright 2017-11-16
Thanks!
I guess for the most of you it is hard to remember your first steps in GCBasic, but for me it was only yesterday...
If there are any fresh starters behind me, you can save yourself the time that I spoiled. I'll try to describe my obstacle run
Before I started I figured it will probably be easy, because I didn't find any posts related starting-up trouble. Now on hindsight I know creating the first "Hello world" is indeed easy but it took me some head scratches before reaching that point.
Please do share because any user experience, especially bad experience, is useful to help us in creating the help files, getting started guides and tutorials.
Even if the bad experience was not with GCBAIC it still highlights pitfalls we should avoid.
The hardest part of getting started in GCBASIC is accepting that it really is easy, I think I spent days trying to work out what I was missing because:
Looked far too simple and surely I need to configure things :)
Cheers
Chris
PART 1, WHERE TO START
It all started a week earlier when I was looking around to where to start. So I found (http://gcbasic.sourceforge.net/starting.html) "Getting Started with Great Cow BASIC". The headscratching began.
Reading the text made it clear to me that I should find an IDE to work in, because it says "Great Cow BASIC is now usable. You can drag the file that you want compiled on to "gcbasic.exe", ..... If you don't like compiling things this way, you can install an IDE"
Ok, so that's clear, I have to install an IDE. The tutor gives 3 optional IDE's: GCB@Syn, Crimson Editor or GCBIDE. I later found that this GCBIDE has nothing to do with the Great Cow Basic IDE which made it even more confusing. So I read all I could about these IDE's but couldn't find a good reason for one above the other.
Ok, let's put that problem aside for later.
Now I was advised to install a Programmer "...to actually do something with the files you compiled". Yes lets do that, because programming the real chip is what it's all about, isn't it? Now 2 options are explained, IC-Prog and WinPic. Again, I read as much as I could about these programs, because I still didn't know what this programmer is for. For the second option, WinPic, I should install MPLAB. So I read about MPLAB. I understood that is has an IDE also (number 4?) and a tool to directly program a PIC MPLAB-IPE. I thought that was what I was going to need.
Today I know there was no reason to worry because it all proved to be very easy. But at the moment I was getting a little desperate. How hard is it going to be to flash a LED?
I finally decided to just start and see what happens, so I went to the download page. Option 1 "Great Cow Basic IDE" was not really about downloading just the IDE but in fact had ALL programs that I needed for my "Hello world"! If I had only taken this step before spoiling days of reading.... life would have been a lot easier.
I was getting anctious now. I had the Pickit3 in the mail that I ordered from Farnell so I was ready to go!
Last edit: JohanDenRidder 2017-11-17
Thank you. These insights do help. I have just redirected /starting.html to the new website. The information on the old page must have been very confusing. It any one wants to re-write and provide us a new replacement GettingStarted page then please sent through - this would be most helpful.
:-)
I started gcb using a uno with no programmer. There's a boot loader built in like picaxe.
I then reprogrammed my 28x2 picaxe chips with gcb using #chip 18f28k22 which is what they are and using pickit2 and in circuit serial programming no prob. That would be like picaxe programming but different pins for rx/tx. gcb uses microchip pins.
I would again suggest a uno which is like a picaxe 28x2. So easy to get running. Less than a fiver and an acrylic case for 2 quid. plug n play.
Anyway there's lots of ways and you'll get help here.
I can express my converting from picaxe to gcb from this project I posted in picaxe forum.
http://www.picaxeforum.co.uk/showthread.php?29727-Picaxe-Tron
now check the gcb version
https://github.com/Anobium/Great-Cow-BASIC-Demonstration-Sources/blob/master/GLCD%20%20Solutions/GLCD%20Games/Snake_for_SSD1306_UNO.gcb
the gcb version has a glcd include to handle the display and the graphics. In the picaxe version I had to create the glcd set up and plot draw print myself...and it was a job
What did you do with picaxe? Looking at turning a led on off picaxe example and then gcb example and see the different key words for port, port direction, port on, port off. That's where to start, syntax differences, not many. GCB is less complicated and more basic than picaxe basic I found.
What board/pic you going to use?
I used picaxe for very different projects. From automating a coffee machine to a smart home heating thermostat to a spindle speed controller for a CNC lathe.
I guess you are about my age so you know that back in the old days, before the microcontroller era, we only used discrete electronics components. I waited a long time before to join the new style of development with microcontrollers. I started with picaxe a few years ago wich opened a new way of thinking when developing. Obviously the system has its limits but still I had a lot of fun with it.
PART 2, INSTALLING THE SOFTWARE
I first installed the software from Microchip "PICkit3 Programmer Application Setup" as I read somewhere that this was an easy tool to program a pic. Again, it took me a long time to find it in the archives of Microchip only to discover later that it was also in the "Great Cow Basic IDE" download. I could have saved me the trouble.
Trouble came nonetheless. After starting C:\Program Files (x86)\Microchip\PICkit 3 v3\PICkit3.exe it was impossible the exit the program. I had to use the taskmanager to stop the program each time. I found the cause of it. Since Windows 7 software developers are not alowed anymore to let their program write anything in the C:\Program Files path anymore. I solved this problem by temporarely copying the complete program to my desktop. Exiting the running program from here works fine. Now you can see a file "PICkit3.ini" has been created. You need to go into the properties of this file, to the security tab. Here you give the file all rights to read and write. Copy this file to the original path in C:\programs and from now on you will be able to close the program normally.
Ok, first hurdle taken.
Now I starting PICkit3.exe with the PICkit3 programmer connected to an USB port only to find that the programmer didn't work yet. I can't remember the error code but is was something like "no operating system found". I had no idea but I tried Tools > Download PICkit Operating System anyway and chose the file C:\Program Files (x86)\Microchip\PICkit 3 v3\PK3OSV020005.hex as it was the only one starting with PK3OS... PICkit3 was now found by the software so I was getting more confident about the project.
Next, installing the downloaded "Great Cow Basic IDE". This was as easy as ticking all boxes and click Install. That's it.
After starting GCB an IDE presented itself so I needed no more worrying about that either.
Now over to the hardware...
Last edit: JohanDenRidder 2017-11-17
Another ex-PicAxer here.
I still like, and use PicAxe, but use it significantly less now I can use 'real' PICs. I say that mostly because I am able to take advantage of the much lower pricing, much higher speeds and much greater memory in comparison to PicAxe.
What I do miss enormously about PicAxe is the much quicker development time. The PicAxe IDE with it's built in fully featured simulator is just wonderful and a great time saver for me. I wish I was in a position to justify the costs of Proteus which offers full simulation of the PICs I mainly use (16F1825/1829) that is almost (probably better actually) as good as the PicAxe one. I have looked at SimulIDE but failed to get anything to work at all, and at the time I looked at it I don't think it supported the 16F1825/1829 chips.
Welcome, and good luck.
Hi mkstevo,
I am getting along experimenting now and started to feel the same thing. The PICaxe simulator seems like water to a fish; you'll miss it once you don't have it anymore...:)
Anobium, gcb dev team, has posted help videos. Try this- https://www.youtube.com/watch?v=O9lrQ5Bzc8U&t=7s
PART 3, HARDWARE
Hooking up the PICkit3 to a PIC required some head scratching again.
As usual, I read a lot (too much?) about the subject. I watched a Youtube video that used an "Xpress Evaluation Board" but I couldn't understand how it worked. With just a USB connection maybe it used a serial programming technique like Picaxe or would the board have an on-board hardware programmer?
For now all I wanted is to find the simplest way to flash a LED.
So I connected the PICkit3 with 5 wires to a breadboard with a PIC12F1840 on it. I checked the Microchip poster that came with the programmer. New confusion! On the poster it said that the PIC Vpp/MCLR must be connected with a 50kOhm resistor to Vdd. Why is wasn't 47kOhm I don't know, it might mean that the value is important. Reading up upon the issue made it even more confusing because all other sources mentioned 4.7k to 10k, even on the Microchip website.
I put in a 47k resistor and later even left it out just for trying. I worked just as well.
Next issue that I couldn't wrap my head around was the power supply. The Microchip poster had an image showing the connections. What I didn't understand was the power connection between the PICkit3 and the target (my breadboard with PIC12F1840). The strange thing was that the PIC Vdd +5V was connected to the PICkit3 output that had also +5V Vdd. So either the PIC or the PICkit should be powered. Not both at the same time because I shouldn't short circuit the power output of the PICkit to the power supply of the PIC, should I?
Apparently I was wrong again but all info on the Microchip poster said I should power the target (PIC). The poster showed on the target (PIC) side an arrow from Vdd pointing upwards so I figured I had to power the PIC which would then power the PICkit3. The schematics added to that misunderstanding: In the drawing of the programmer it says literally: "Target Vdd is used to power the IO drivers in PICkit3". Also, the "Recommended settings" said: "Power supplied by target". Needless to say that this didn't work? So don't let the drawings fool you; the power connection of the PICkit (pin2) is an power output only, you cannot power the PICkit with it.
Ok, so what then? It leaves nothing else then to power up the PICkit with the USB cable. I didn't connect a power supply to the PIC because I didn't want to fry anything. So without power to the PIC programming started. It worked, it seemed like the hex code flowed to the PIC! Now I had to power up the PIC to see the LED flash. It did. My first success on a blank PIC. On the next try, when sending a new hex file to the PIC, I forgot to disconnect the PIC power supply. Nothing exploded! In fact, PICkit3.exe showed a message like "external power detected". Ah, ok. So I was making a lot of trouble about nothing. If the PIC is not powered the PICkit takes care of it. On the other hand if it is powered, PICkit will sense that and doesn't supply power to the PIC. No harm done. Why did I go through all this trouble? I cost me the best of a day trying to figure it all out on forehand.
Now how did I get the HEX in the PIC?
From "C:\GCB@Syn\GreatCowBasic\Demos\LED Solutions\LED - Simple PulseOut" I took "BlinkLED using PulseOut 16F886". It looked like this:
chip 16F886, 16
Do Forever
PulseOut PORTB.5, 500 ms
Wait 500 ms
Loop
I changed the first line to "#chip 12F1840", "PORTB.5" to "PORTA.2" and pressed F5 (F5 being a lucky shot because I used to do that in Visual Basic). PICkit3.exe started but raised an error "Device file PK2DeviceFile.dat not found. Must be in same directory as executable". Couldn't solve that problem so I looked further and found F6 to compile without flashing. This worked.
By then I still had no idea that my next step would be successful. I started PICkit3.exe and clicked "Auto Import Hex + Write Device". I browsed to the path where I expected the hex file to be and clicked on it. Right away programming of the PIC started. That easy!
Later I found that if I left open the Auto Import function, things were even more easy. I could edit a basic program and press F6 to program the PIC real time. PICkit3.exe kept polling the last used file name so each press of F6 did the complete sequence of compiling to hex, importing to PICkit3.exe and programming the PIC.
One cick, as simple as Picaxe, so to say.
Ok, I finally had my flashing LED. In the end I found myself with a minimal setup: only a PICkit3 programmer and the GCB download package. That's it!
No extra hardware in the form of boards or Arduino's, no extra software like IDE's or MPLAB or any other utility. Just a PIC on a breadboard with no extra components and a PICkit. This really was what I was after.
Maybe you are a lot smarter than me, in which case you are not going to waist as much time as I did. For other novices I hope my experience may be of help to you.
Regards,
Johan.
Last edit: JohanDenRidder 2017-11-17
Stunning summary... In the end I found myself with a minimal setup: only a PICkit3 programmer and the GCB download package. That's it!
Well done.
Glad you sorted flashing a pic with gcb.
I used this method. Simple and works but I use pickit 2 for the pics I use. http://ww1.microchip.com/downloads/en/DeviceDoc/31028a.pdf
That is a great story Johan, and one that I am sure many of will sympathise with.
You mentioned the Xpress Evaluation Board and that is Microchips answer to what you experienced.
It is literally just plug and play in Linux, Windows and IOS.
You noticed it appeared as a com: Port on the PC but that is not a bootloader as you surmised, it is a USB/Serial Bridge similar to an FTDI deviceand is provided only for your convenience. The actual programmer appears as a Drive Letter.
The one I currently have hooked up appears in file explorer as XPRESS (F:).
No drivers required, no fancy power supplies or current limiting resistors.
Just copy the Hex file to Drive F: and you have programmed your PIC.
There's not much we can do about the Microchip documentation but we can certainly improve the GCBasic Documentation. It had slipped hopelessly out of date and, as we were all seasoned users, we never noticed.
Thanks for the inspiration to tackle the task.
Cheers
Chris
I didn't know that Chris cos I haven't got a xpress board. You mean you plug it into win usb and it comes up as a mass storage device? Amazing.
Not much of a pic though or am I missing something? I use 18f25k22's for most dev. mega328 is good for most stuff too but I only use gcb, no mplab stuff. The only microchip program I used was mpasm.exe for assembler once.
Clone Uno board £3.90 buy 3 instead :) ... sorry, I like them. and the fake chips socketed.
Hi Stan,
Yes it appears as a mass storage device on Win, Linux and MacOS, and if you think it is not much of a PIC you certainly are missing something.
It is one of the new enhanced Mid range Core devices, with device independent peripherals.
If you look at the Pinout diagram hardly any peripheral pins are indicated, not because it is devoid of them, but because it has so many there are not enough pins to even start to accommodate them.
The solution is PPS (Peripheral Pin Select) which not only lets you decide what peripherals you want to use, but what Pins you want to allocate them to.
Amongst the many onboard peripherals are:
4 x Configurable logic cells - think PLA (Programmable Logic Array) capability.
A Numerically Controlled Oscillator - think DDS waveform generation.
ADC with computation - They do there own math and leave the core to do other things.
Digital to Analog converter
Data Signal Modulator want to encode Gray Code on the fly, or maybe drive a radio transmitter?
Zero Cross Detect so you can synchronize to an external waveform, say the mains frequency.
And that is above and beyond all the normal peripherals you expect in a high end PIC, like 2x SPI ports and 2x I2C channels. 1KB of RAM and 256 Bytes of EEProm...........
The list goes on.
The only device that currently tops it is the PIC16F18877 which is the same core but in a 40 pin package with 4KB of ram.
Take a look stan, at $12 it may cost the price of several clone Arduinos, but it has considerably more bang for the buck and is an excellent learning tool as you have all those peripherals to experiment with in a small and comfortable package that requires no external programer, bootloader or FTDI device, they are built in already.
Cheers
Chris
I only checked it briefly. I've seen the chip for £2. Maybe I'll share your enthusiasm if I got one.
32K flash but can address 64K. Please explain the point.
32MHz. Am I right 18Fxxxxx are/can be 64MHz and faster is better? Or we'd be using old 4MHz pics.
Does it run code faster than older pics same clock speed?
4 x Configurable logic cells - think PLA (Programmable Logic Array) capability.
Think sloppy pcb design-dim problemo, you can fix it later :)
A Numerically Controlled Oscillator - think DDS waveform generation.
square wave or sine?
ADC with computation - They do there own math and leave the core to do other things.
what computation?
Digital to Analog converter
Data Signal Modulator want to encode Gray Code on the fly, or maybe drive a radio transmitter?
Zero Cross Detect so you can synchronize to an external waveform, say the mains frequency.
no one uses the mains frequency any more do they? except for ac motors.
This can answer better than me:
PIC16(L)F1885X/7X microcontrollers
and then look here:
AN1523 - Sine Wave Generator Using Numerically Controlled Oscillator Module
AN1660 - A Complete Low-Cost Design and Analysis for Single and Multi-Phase AC Induction Motors Using an 8-Bit PIC16 MCU
AN1470 - Manchester Decoder Using the CLC and NCO
Want More:
http://www.microchip.com/wwwproducts/en/PIC16F18855
And do yourself a favour, get the Xpress Development board, not just the chip. The Programmer and USB/Serial converter are worth it and the MikroBUS offers as many perephirals as the Arduino Shields but without the wierd footprint. Much greater portability.
See here for an idea of the range:
https://shop.mikroe.com/click
Cheers
Chris
sold. ordered this http://uk.rs-online.com/web/p/processor-microcontroller-development-kits/1229825/