I have a few projects that I want to make on a budget, I am happy programming PLCs in ladder but have never touched a PIC. They do seem to offer some reasonable versatility and the cost is pennies. My questions are who here has experience I’d them? Is there an easy way to program them or can ladder be converted easily? How to assign I/O? I have one PIC that I purchased online, it is programmed already but I want to modify it, in ladder it would be a single line of code, in PIC I have noooooo idea.
Any suggestions?
Most helpful. Thank you.
We programme about 3000 microchip devices a day, are you after writing the program or blowing the device?
I have an existing device. It’s a PIC18323 and is programmed to do one of two things when I lower the roof of my car, it gets inputs from the roof switches and as the windows drop and it sees the roof has been latched either fully up, or fully down, it then uses pins 5 or 7 ,and 8 or 9 to either lower or raise the windows by using a three second timer to those pins.
What I want to do is add code so a double click of the up button will trigger pins 5 and 7 on the same three second timer to auto close the windows, the car has no auto up as standard only auto down. The device does monitor the switches so this would be a simple code issue no hardware changes needed.
Also, I am trying to decide if I connect both pins 5 and 9 to the raise termination of the window switch will the back feed damage the IC. It’s designed to open via pin 9 close via pin 5 but I don’t wish it to be able to open the windows, only close them.
Thanks.
Ok I have found that the IC has open drain outputs so there is no detriment to using them in pairs or connected together.
Just need to find out about coding now but truth be told I think that’s going to come to a dead end.
Thanks again.
A little while back I did something similar for a friend who was restoring an old classic (as he described it) lorry. He was looking for a simple controller to drive a bar of flashing orange hazard/warning lights he had mounted on the cab.
I can't recall offhand exactly which microcontroller I used, but it was an eight bit flash programmable one from Microchip's Atmel ATtiny family.
I'm still a little confused over how you are expecting to be able to program (or modify) the 16F18323. Are you planning to (re)write the program and upload it, or hoping to somehow modify the code/device in situ? (In either case do you have access to the source code?)
There are a number of tools and utilities which are freely available to program these types of microcontrollers, not least from Microchip themselves, eg https://www.microchip.com/design-cen...et-started-now
I'm sure you are making enquiries in various other places as well, but I'll just concur with reggie747's advice, eg https://www.microchip.com/forums/f516.aspx
I was planning to upload the program from the IC and modify it, then download back to it with the extra code. I know I would have to but the interface hardware but it’s something I would be using more than once so that’s fine, and I like tinkering, it’s just what I enjoy.
The problem here is it seems to be basically ‘C’ and I can’t program it, ladder and logic etc yes, but ‘C’ is another storey.
I did a bit of searching about the processor and found the links you posted. Think I’m just going to do it the easy way and use preprogrammed controllers and select the operations I want from them. Shame, I would have enjoyed the versatility they offer.
Thanks for the reply’s 👍
Modifying the code without having the source code will probably be very difficult unless you are very lucky and the existing device is unlocked, you could try reading it with a picmate
Unfortunately this approach isn't really feasible. You are almost certainly correct in assuming that the program has been written in something like C, which will then have been compiled into the native instruction set for the microcontroller you are going to use. (As Adrian has already pointed out whilst I was typing this.)
However if what you are looking for is a gentle introduction into the C programming language, along with implementing it on programmable microcontrollers, then you could do a lot worse than checking out the readily available and relatively inexpensive arduino products.
Looks interesting, I’m going to do further reading. I am under no illusions though, it’s not easy and if I don’t dedicate my self to it I won’t learn enough to be competent, and truth be told I don’t have that sort of time/dedication. I do have time to play a bit.
Thanks again for the replies.