Skip to main content

Posts

Showing posts with the label PIC

Push button Ezypoints

 A few months ago I produced a batch of Ezypoint kits for our local members to overcome a shortage in the Kitlocker.  At that time the kit was produced on stripboard which some members find problematic. An additional PCB board normally available from MERG was not available either.  Alan Turner ( the PCB designer) had only a few boards available but graciously provided me with the gerber files to allow me to order PCBs directly from China . Having sourced all necessary components, the kits were duly made up. I find this simple kit is really useful for automation projects. A toggle switch provides either a HIGH or LOW on the PIC input pin to determine which of the two servo positions is selected. For a particular application, I wanted to use a push button to toggle the position on alternate presses of the button. This involved a rewrite of some of the code in the PIC. I initially developed the program using an Arduino as a means of testing the logic. When this was successfu...

PIC Projects

 Two interesting PIC projects were shown at JALSIG's last meeting which is now available to view on MERG TV. Brian Norris demonstrated a program which simulates eleven lit traffic cones working in a chaser sequence as you would see on a motorway or roadworks. Developed using a 16F18323 chip, Brian explains how he moved from a very basic program to a more sophisticated one using the pintools function. This was followed by a presentation by Ian Hart showing a CANMIO board with modified code that checked the inputs and outputs in a specific sequence.     This apparently is a really useful tool to fault find boards coming from other members to ensure outputs and inputs are soldered properly without shorts or bridges. The session was recorded and is available on the JALSIG area of MERG TV You would have to join the Group through the area groups page.

PIC Programming Add-on

 I have been using my PIC Programming Kit for a number of years.  In the main, I have downloaded the relevant Hex files from the MERG website and written them to whatever PIC was required, either for my own projects or for those of other members. PICs can be significantly smaller than Arduino Nanos for example and as I sometimes model in N gauge, space matters. Following a previous post on carriage lighting, I considered using Davy Dick's PMP 19 as a starting point. Even a 12F675 PIC takes up a fair amount of room, but then I came across an SMD version of the same device. It's much smaller and surprisingly cheaper than the original, but how the hell can you program them? I found this device on AliExpress which simply plugs into the programmer using the standard pitched pins on the base. The SMD device sits on the top and a set of spring loaded pins then secures each pin above and below to ensure good contact. Works an absolute treat.  Now all I need to do is design an SMD...

Document First - then Code

 Davy Dick's talk to the JAL Special Interest Group last night was a not to be missed event for anyone wishing to program in any language. The critical analysis process was succinctly expressed as " If you can't describe it - you can't code it" Comments in a program are essential for the understanding of others and for yourself if looking at it after a prolonged delay. Davy suggests that we shouldn't write code and then comment on it, but the opposite. Write comments describing your requirements and then write the code for each part. Davy used a few examples to outline his method of designing using Psuedo Code. A road roller, a canal boat with intermediate animations, a traffic light simulator, a lighthouse and Ezypoints were demonstrated and discussed showing different programming methods. I would recommend that you watch this presentation which is now available on the JALSIG area of the MERG website. You might have to Join the JAL Special Interest Group to...

Interested in Programming Technique?

The JAL Special Interest Group has a meeting on Monday 14th September at 19:30     These are sessions that are open to all members, both in the UK and internationally. It normally discusses programming PIC chips using the JAL programming language.  Davy Dick from the West of Scotland Area Group will be the guest speaker and will be discussing how he goes about starting a program from scratch, using his automated canal barge and the traffic lights Pocket Money Project as examples.  As this session covers programming technique, it is also useful for Arduino and other platform  programmers.  If you have not yet signed up to JALSIG then you will have to   update your profile

JALSIG Meeting 10th August

 Monday's meeting of the JAL Special Interest Group was very well attended.  This was not a beginners meeting but one for members to share their current PIC projects.  As many of us are very new to PIC programming using JAL (Just Another Language), we were relying on a more experienced member to show us something. Simon West gave us an excellent description of a dual seven segment display which is used to broadcast sequence numbers to the operators at his local model railway club. The video of this presentation is now available on the MERG website. You will have to join JALSIG to view the video. The next meeting will be a beginner's one where we will all attempt to switch on a couple of LED's with a couple of switches. We all have to start somewhere. Interested?  JOIN JALSIG NOW Andy R

PIC Programmer

If you want to program your own PICs or upgrade them to the latest version, a PIC programmer is an essential tool This one can plug directly into the included Zero Insertion Force (ZIF) socket but an additional pin to pin extension cable is also provided. The PIC chip needs to be removed from the board and placed in the correct location on the ZIF socket. It supports 8, 14, 18 and 20 pin devices. The jumpers need to configured specific to the device in use. On some PCBs an ICSP (In Circuit Serial Programming) header is provided. This allows the Chip to be programmed on the board and is a common feature on some of the MERG Kits. The cable provided above is NOT suitable for ICSP use. A short cable needs to be made up specifically for onboard programming. The cable should not exceed 6 inches ( 150 mm ) in length. Greater lengths can be problematic, particularly for K type PICs Andy R

PIC Development Boards

The JAL (Just Another Language) online course is just about to start.  At the inaugural meeting of the JAL Special Interest Group last week, a few suggestions were made for suitable PIC development boards. The 50 mm x 50 mm  board above is from Fraser Smith and is the same one featured in his automatic signals articles featured in the March and June 2020 Journals.  At £1.40 for one and only £1.80 for two that include the 20 pin DIP socket,  my choice was clear. The advantage of this board is that it can be used for 8, 14 or 20 pin PICs, The second potential board is designed by Alan Turner. It is slightly smaller at 50 mm x 33 mm but can only support 8 pin PICs. Given that most of the pocket money kits produced by Davy Dick utilise the 8 pin  16F765 chip, perhaps this will not be an issue, The board is available in two versions, differing only in the power capabilities of the onboard  5 Volt regulator. ( 78L05 or 7805 ) This board can be used to build some ...

Sunday's WOSAG Zoom

Another excellent Zoom Meeting this afternoon run by the West of Scotland Area Group. Over forty people joined the meeting. Davy Dick first showed us a  commercially available multi function stepper motor driver module. Operating between 5 and 12 Volts it works on both four and five wire motors. Four different operating modes are available selected by jumper. There are two push button switches on the board that have different effects depending on the selected mode. These switches could be removed and replaced by external ones.  In addition a 4pin header allows further  connection to switches or sensors. The large pot controls the speed of the motor and the smaller one, the length of travel when that mode has been selected.  This is a good board for simple end to end travel ( shuttles) and costs less than £5 on eBay (other suppliers are available).  Davy demonstrated it working driving a NEMA-17 motor with  lead-screw and limit switches and then with the muc...

Terminal Block Saving

I have just ordered a couple of PIC development boards from Fraser Smith in preparation for the JAL (Just Another Language) Zoom course starting soon.  I ordered some 11 pin 3.5mm pitch terminal blocks from RS which are priced at 63 pence each. This is only 2 pence more than the four pin. As you can see they break up to form 3 off 3 pin  and 1 off 2 pin connector. These connectors fit the EzyBus input module ( 3+3+2) for each 8 pin row with a 3 pin left for other projects.   If you are interested in finding out about PICs and PIC programming, there is still time to sign up for the JAL Special Interest Group. See previous postings for details Andy R

Special Interest Groups

You may or may not be aware that there are some Special Interest Groups ( SIG's) being created within MERG. It is easy to get involved by going to the relevant page on the website. I've put the link here  for your convenience. I have always been fascinated with what is happening inside those Pocket Money Kits and the JAL Group (Just Another Language) will show how this PIC chips get programmed. The Inaugural Meeting took place tonight with beginners, intermediate and experts attending. In future there will be fortnightly meetings. One of the meetings will be in the form of a beginners course and two weeks later a general meeting. Everyone is free to join both. If your interested in finding out about JAL and PIC Programming there is a new section in the Knowledgebase section of the MERG website you can have a look at. https://merg.org.uk/merg_wiki/doku.php?id=sig:jalsig You can find out in the Useful Equipment section what you will need to participate. Cheers Andy R