Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
the project could use 10 players, battery powered, 17-20
looking at the 18f44K20, 25K22 & 26K22
I have a board layout but it was only 1 game option. This new project is a combination of Mexican Train and a fast version of Mexican train I call Bullet Train.
With the 2 games I need more pins since the 1 game option uses a 18f2221 with no issues (a 28 pin pic)
I apprciate your input Jon. Have viewed several videos using a soldering iron and lots of flux. Since I started using Chip-Quik flux for soldering a SOIC pic, I am able to solder each pic in under 90 seconds with no solder issues.
Trying not to add more chips as the cost increases. I got lucky that I found lighted LED mom switches but at $2 each, decided to go with small tactical push-button similar to the ones on the Tap 28. In fact that's where I got the idea to use a small cheap tactical switch.
I did a search on the microchip site and the parametric search came up empty, only K series. I want to stay away from the K series but have used them in a project with success but not without programming issues.
Doing more searching for a better choice and hopefully not a K series. The voltage range is enticing and may have to go with a K series.
Before someone gets the wrong idea, I use swordfish with the 18F K and J series parts with no issues.
The problem is with the libraries. Many of them are written for the older parts and haven't been updated. Since libraries in swordfish are source code you just have to modify them to support your newer part.
Almost every new part Microchip does changes something. Even they quit trying to keep their libraries up to date and now force you to use their MCC code generator (which doesn't support many parts at all).
Same goes for the programmers. The pickit2/pickit3 standalone apps haven't been updated in years, so if you use a "new" part you may have issues there too. You might have to switch to the mplabx IPE/command line drivers which brings in a whole new set of problems.
Good point about the K-series chips and Swordfish. As I said above my "go to" chips are the 18F25K22 and 18F26K22 where I need more memory.
Swordfish is unique that the libraries are written in Swordfish. common problems with newer chips is that a register name jas changed or the pinout for a hardware function has moved. These type of problems Re usually not too difficult to resolve with some assostance from t&e dats sheet.
MrDEB's; infamous troibleshooting skills, where the syntax of an improperly formatted if/then can take 4 pages, make him a good candidate for the traditional parts.
I like Pommies idea of a 4 x 5 matrix to read the switches and enable desired LED. Just need to take a closer look at implementing the idea.
thinking using byte to determine which switch has changed state.
more research to best approach
This probably has nothing to do with what MrDEB is trying to do but he hasn't been too clear about that so who knows.
This is a random thought. MrDEB, just ignore this if it doesn't apply.
If one wanted a "buzz in" system where the first button to be pressed has control and the rest are ignored, for up to 8 switches, an MCP 23008 or MCP23017 would do all the work for you. Interupt-on-change detwcts when any switch is pressed, and one of the registers
But even if you use the MCP23017 with 16 I/O pins, you are limited to 8 switches. The chip is divided into separate halves.
Hunting rabbits...I mean PICs...is a very arduous task, made even more difficult when recommendations have been made. Mike's recommendation includes EEPROM, so lets go with that just in case there turns out to be some reason you do need to save some info between games.
Mike recommended the 18F2620 or the 18F4620.
Here's the first secret you must have been ignoring on the front of the data sheet:
- 2620: 28 pin part
- 4620: 40 pin part
Only the first digit changes to go from a 28 pin part to a 40 pin part.
Stop sputtering - the TQFP package has 44 pins, but 4 of those are nc. It's exactly the same part as the 40 pin DIP package inside.
"But I want the LF version..."
Stop whining. For the baseline series, there is always an LF version.
18LF4620 should be just what you need.
So let the hunt begin. 10 seconds on Octopart and you'll know what's available. Very difficult.
But how can you be sure that's the part you really want? 2 to 4 and add L? Who believes that works? Microchip will show you it is. Note, there isn't a separate spec page for the LF version.
Connect your switches to Port B whether or not you use the 40 pin version. Don't design in something stupid from the start. "It got the wrong reading. I told you, only one person can press their button at a time!!!"