Always a learning experience.
Yep. The beveled side is the other indicator.
WOW. Dead shorts from power to ground can be pigs to find. The solder mask registration was a gnats kneecap out so the solder from an 0805 resistor just bridged a nearby track that was only 90% masked. I had to crank up the microscope to full blast and look at every component in turn and it was still very difficult to spot. Just imagine if this had been a large board.
Brilliant link. Thanks.
This is why I hate software so much. Well a few reasons. On the atmega128 dev board the RX interrupts worked fine. I could send data in and out. On the atmega328 boards (ie mine) the ISR for receipt is triggered but the data which kicked off the interrupt is blank. I cannot afford the tools that can step into an ISR and I am not too sure how to trigger a data receipt interrupt with the simulator. Or if it would be meaningful. The Data Visualiser works for monitoring data out but I cannot send it in and have the code stop on a breakpoint.
So in deep frustration I looked at the STM32 ARM cortex M4 MCU. (particularly the very nice, quick, dev board (STMicroelectronics NUCLEO-F401RE ) which is super cheap and loads of good tools. A bit more rummaging and there is a MBED 5 port of the freeModbus library. Nirvana!!
Click on API documentation. Like almost all software developers I have ever known documentation is (unless I am being really myopic) totally missing. Just the source code. How many developers have said “My code is self commentating, I need almost no comments or documentation”. OK I am ranting but I am a massive believer in documenting everything. I would rather plow 50 pages of dense but totally comprehensive explanatory text than any number of comments that only the author understood.
New boards (the final ones from a cheaper supplier) are on the way. If they are good I will get the motivation to try again or not use interrupts for data receipt which is possible but painful. I have a bread-boarded atmega328P so I could dig out the logic analyzer and have a trace on every pin. Old fashioned perhaps but why not if it helps?
The power board PCB is due soon and all the parts are in including a nice compact lipo so at least that should be finished in the next couple of days.
Yeah, this had me excited until I read the rest. No one else is utilizing this/helping document it on the web? Any chance to ask about it on their forums as well? Maybe there’s a hidden PDF somewhere?
I always think this is a good idea regardless, just to check that reality is matching what I’m seeing on screen. In my case it’s almost always overkill…but at least i know it is
The new boards have arrived from JLC. Ten for 1/3 of the price of OSHPark, and quicker delivery to boot. They are double the thickness as well so very solid and tinned. I have an ‘improvement’ re-spin of the main PLC on order but the current boards are good enough to be put into their boxes and mounted under the rail baseboard ready for wiring. The power board has arrived so I can convert my train to battery operation. Once tested out that bit is done.
I have toyed with other MCUs for the main PLC but have decided to produce a MK2 using the atmega128. The chip is five times the price but much more versatile. More ports, inputs, USARTS, etc. I hope to use lessons learned from the train PLC to increase layout density and have 3 times the number of ports for only about 30% more board area if that. It will also have local memory for storage of downloaded code and parameters.
The RS485 interfaces have been totally reliable, as they should be. I will implement using my own packet structure and will migrate to modbus in time.
So for now a brief hiatus (and wingnut wings Sopwith kit to be built) before recommencing the rail layout build out.