|
Homebrew Equipment A place to show, design and discuss the weird and wonderful electronic creations from the hands of individual members. |
|
Thread Tools |
15th Nov 2019, 10:20 am | #1 |
Tetrode
Join Date: Sep 2017
Location: Luton, Bedfordshire, UK.
Posts: 53
|
Turbo Molecular Pump -Firmware for PIC18f4520 microcontroller
I have had in mind for some time to set up a high vacuum system to experiment with homemade thermionic valves, ambitious I know but it is a fair challenge
I have a nice roughing pump, ion gauge, some Pirani gauges and a controller, I have also obtained an Alcatel molecular drag pump but unfortunately there was no controller with this and it looks like a proprietary unit is hard to find. I have the schematic for the original Alcatel controller and most of the chips utilised in it, one option which I am considering is breadbording the circuit and attempting to run the pump using this. The other option comes from an article on using a PIC chip to run the pump via a TAS 5261 amplifier. Here is a link to the webpage for the setup: http://www.wimmeralogic.com/adixen-a.../MDP-5011.html My problem comes with the firmware, the author states the following: "The firmware for the PIC18f4520 microcontroller is written in PIC assembler Pic18pwm Assembler Source , Register Definitions , General Macros , Handshake IO via programming pins , and compiled using open source tools. The definitions for the register names and locations are in a copyright macro file published by Microchip. A copy of the file is Microchip Register Definitions , which I renamed pic4520.a18 for consistency" I have worked with C++ before using Arduino, and I'm familiar with header and library files but I'm a bit daunted about compiling the firmware for this, my main difficulty is knowing where to put the various files listed into MPLAB X IDE. I have studied some YouTube videos but they are all very basic "Blink" tutorials and I'm struggling to see where the whole thing hangs together. Can anyone tell me where each file should reside within the IDE? Many thanks Alan |
15th Nov 2019, 11:10 am | #2 |
Octode
Join Date: Jul 2009
Location: Carmel, Llannerchymedd, Anglesey, UK.
Posts: 1,509
|
Re: Turbo Molecular Pump -Firmware for PIC18f4520 microcontroller
Not got the time to delve into this, but from past experience, I have done lashings of projects using mirochip assembler and was a bit cautious about delving into C for a later project. I need not have worried. Firstly the configuration stuff is easier to set up by just clicking options on the latest IDE. My biggest puzzle was how to interpret things like bit setting and shifting in the C prog. I found the lashings of stuff on the microchip forums of great help. Generally a look at the appropriate microchip '.h' file will reveal what to do.
|
15th Nov 2019, 11:27 am | #3 |
Tetrode
Join Date: Sep 2017
Location: Luton, Bedfordshire, UK.
Posts: 53
|
Re: Turbo Molecular Pump -Firmware for PIC18f4520 microcontroller
Thanks very much for your reassurance
I have also joined the Microchip forum with a view to asking the question there. I guess you could say that although I have used Arduino IDE, I really have no solid experience with C++ except for the very basic setups and cobbling together someone else's coding for making an Arduino shield which I copied work to drive a stepper motor on my lathe as I wanted an "Electronic Leadscrew". I learnt a bit from that but I'm still very much a newbie at the coding side of things. Cheers Alan |
15th Nov 2019, 11:38 am | #4 |
Octode
Join Date: Jul 2009
Location: Carmel, Llannerchymedd, Anglesey, UK.
Posts: 1,509
|
Re: Turbo Molecular Pump -Firmware for PIC18f4520 microcontroller
Can't help you with C++, for which I have a pathological hatred! I have always thought it to be the answer to a question that nobody asked. No problems with plain C though. I really prefer to do the PIC stuff in assembler, but C is very helpful and quicker if you need to do some hard sums. What really impressed me was the efficiency of the microchip interpreter which produces for example, text from 'printf' statements which seem to be as economical in the final code as doing it the long way!
|
15th Nov 2019, 11:55 am | #5 |
Tetrode
Join Date: Sep 2017
Location: Luton, Bedfordshire, UK.
Posts: 53
|
Re: Turbo Molecular Pump -Firmware for PIC18f4520 microcontroller
Thanks very much
I'm nowhere near the level of experience you have with this, it would be nice if I could write some code for this from scratch, possibly using assembler, but for this problem I am trying to use the code provided by the third party. The problem is, as you can tell, I have only a little idea of how to do this It's a very big ask, but if some kind soul would like to send me the compiled code so that I can simply load it to the PIC chip I would be very happy, then I can get on with the hardware side of things, at which I am much more proficient..... Cheers Alan |
15th Nov 2019, 12:17 pm | #6 |
Octode
Join Date: Jul 2009
Location: Carmel, Llannerchymedd, Anglesey, UK.
Posts: 1,509
|
Re: Turbo Molecular Pump -Firmware for PIC18f4520 microcontroller
Alan, if someone has already done this it would obviously be the quick solution, but to address it from scratch would require a great deal of time.
If it is a help, I have included some very simple example software which controls an explosive detonator initiator. I have included the assembler listing and a state transition diagram which should explain what it is trying to achieve. It would be a simple task to re-write this in C, as the microchip .h files interpret the register names, etc. directly. Also, when using the IDE and C, all the config stuff which appears at the top can be selected without resorting to direct code. Another advantage is that things like timing can be directly entered in terms of micro/milliseconds without having to code delay loops! Les. |
15th Nov 2019, 12:21 pm | #7 |
Octode
Join Date: Jul 2009
Location: Carmel, Llannerchymedd, Anglesey, UK.
Posts: 1,509
|
Re: Turbo Molecular Pump -Firmware for PIC18f4520 microcontroller
Sorry - I copied the wrong text file....
Try the attached here! |
15th Nov 2019, 12:57 pm | #8 |
Tetrode
Join Date: Sep 2017
Location: Luton, Bedfordshire, UK.
Posts: 53
|
Re: Turbo Molecular Pump -Firmware for PIC18f4520 microcontroller
Hello Les
Many thanks for your responses, I will have a look at it all and digest....no doubt there will be something which I can learn from this as I really do need to improve my overall understanding of the subject...... My main aim was to use the substantial amount of code already written for the specific application I wish to implement. I thought that it would be relatively easy to grab the files listed in the link to the TM pump website, drop them into MPLAB X (in the appropriate file locations, which was the basis of my initial question) and used the built in compiler to load it to the PIC- maybe that is oversimplifying things because of my lack of understanding? Anyway, thanks again Alan |
15th Nov 2019, 2:02 pm | #9 |
Octode
Join Date: Jul 2009
Location: Carmel, Llannerchymedd, Anglesey, UK.
Posts: 1,509
|
Re: Turbo Molecular Pump -Firmware for PIC18f4520 microcontroller
That should be quite possible to achieve - but I assume that you have an appropriate programmer e.g. pickit 2 or 3? If that is the case, look again at the supplied code and see if it includes the HEX file. That being the case, you need not bother with the IDE at all - just use the operating app. for the programmer and load the HEX file from that. If not and you just have the '.asm' or text file, load that into the IDE to compile it. Use the basic IDE, rather than the MPLABx stuff which is far more complicated than you need for the job.
|
15th Nov 2019, 3:17 pm | #10 |
Tetrode
Join Date: Sep 2017
Location: Luton, Bedfordshire, UK.
Posts: 53
|
Re: Turbo Molecular Pump -Firmware for PIC18f4520 microcontroller
Hello Les
I have checked the files listed in the link given in my first post, unfortunately I can't see hex files in any of the ones listed. If you would like to take a look at the link in the first post and the associated files to confirm my conclusions I would appreciate it very much, but I would fully understand if you do not have the time as this is a bit of an ask so don't feel that I expect you to sort this for me or that I'm expecting further help. Apologies for being clueless on this...... All the best Alan |
15th Nov 2019, 3:19 pm | #11 |
Tetrode
Join Date: Sep 2017
Location: Luton, Bedfordshire, UK.
Posts: 53
|
Re: Turbo Molecular Pump -Firmware for PIC18f4520 microcontroller
Oh, I forgot to say, yes I have a Pikit 3 linked to the chip via a breadboard.
Alan |
15th Nov 2019, 4:32 pm | #12 |
Octode
Join Date: Jul 2009
Location: Carmel, Llannerchymedd, Anglesey, UK.
Posts: 1,509
|
Re: Turbo Molecular Pump -Firmware for PIC18f4520 microcontroller
You are right - it aint there, so you only have the option of sorting and combining those disparate files and compiling/linking it all. Not a trivial first task on someone else's stuff. Can you perhaps mail the author and ask for a hex dump?
|
15th Nov 2019, 4:42 pm | #13 |
Tetrode
Join Date: Sep 2017
Location: Luton, Bedfordshire, UK.
Posts: 53
|
Re: Turbo Molecular Pump -Firmware for PIC18f4520 microcontroller
Hello Les
Thanks so much for taking the time to look Agreed, I am indeed very daunted by the task of trying to assemble all of those files! Yes, that's a very good idea, I will try to contact the author and get the Hex file. All the best Alan |
15th Nov 2019, 5:05 pm | #14 |
Tetrode
Join Date: Sep 2017
Location: Luton, Bedfordshire, UK.
Posts: 53
|
Re: Turbo Molecular Pump -Firmware for PIC18f4520 microcontroller
I have now contacted the author of the code in the hope that he can help.....
I let you know if I get a response. Thanks Alan |
15th Nov 2019, 5:31 pm | #15 |
Octode
Join Date: Jul 2004
Location: Evesham, Worcestershire, UK.
Posts: 1,423
|
Re: Turbo Molecular Pump -Firmware for PIC18f4520 microcontroller
No thing to do with the code but this website could prove a goldmine of useful information
http://tubecrafter.com/ The guy posts a lot of stuff on y/t and makes it all look easy in a nice dress, I'm sure it ain't easy though!. Greg.
__________________
Picture, sound?, DOOR. |
15th Nov 2019, 5:58 pm | #16 |
Tetrode
Join Date: Sep 2017
Location: Luton, Bedfordshire, UK.
Posts: 53
|
Re: Turbo Molecular Pump -Firmware for PIC18f4520 microcontroller
Hello Greg
Yes, thanks very much for this, it is in fact where all of this started! Ron Soyland (tubecrafter) from Texas, is definitely a genius, he has also helped a chap called Dalibor Farny to set up a production facility for making new NIXIE tubes. The story of how Dalibor did this is well documented on YouTube. And here: https://www.daliborfarny.com/story/ I have no connection to either parties other than an interest in their work. I hope that the link does not break forum rules. Regards Alan |