0 Members and 1 Guest are viewing this topic.
Well said - I plan to offer a pre-flashed SD card and a case with the power supply too so that it becomes a truly plug-and-play system - all you would then need is a keyboard, mouse, and monitor.
And the Arduino mentioned above?
And the Arduino mentioned above? Sorry for asking, but I've never had one. I am only using a Raspberry Pi2 with OpenELEC, but that's it. I have no further experience with those small and "geeky" computers. Javier
Update - I'm working on a new version of the HAT that also includes hardware for an OpenLCC system. There will be one or two RJ45 jacks, and I will also be adding a 5V power supply so that you can simply plug the power supply, HDMI, mouse, and keyboard and start running the device. No micro USB needed. There's also some other improvements coming... stay tuned.
Hi David,Very interesting - you've been busy... I took a look at the "BoosterHC HAT V0_2" schematic https://github.com/cescalemodels/BaseStationHAT/blob/master/Hardware/BoosterHC%20HAT%20V0_2.pdf and it looks good. Be great to have an OpenLCB DCC Command Station we can customise.A few questions and comments:1) What is the purpose of the TL7660D and the EXP0 connector?2) If you switch the MCP2551 to a MCP2562 you can eliminate the 3.3V to 5V voltage level converter components as the MCP2562 has separate VIO and VDD pins to handle interfacing to 3.3V controllers and still drive the CAN Bus at 5V.3) Have you been able to validate the performance of the MCP2515 CAN Controller connected to the RaspBerryPi as I've seen mixed feedback. From an OpenLCB/LCC perspective it's critical to send and receive CAN frames in order. The MCP2515 is a common chip and there is wide support for it in the Linux kernel and lots of application notes, but it does have issues with buffering and maintaining frame receive ordering. We've used the MCP2515 with the Arduino in early OpenLCB prototypes and battled with it for a while. We eventually gave up and went to using the AVR AT90CAN128 chip with on-chip CAN controller and had a lot more success.However, recently some other people are wanting to try the MCP2515 again but this time using interrupts, so hopefully that might improve things. I've got one of the MCP2515 interface board from eBay to try it again on the Raspberry Pi and the Arduino, also someone else has mentioned some work-around for problems in the silicon so that may help too.4) Would you consider bringing out the PB0(ICP) pin12 + PB1(OC1A) pin 13 on the ATMega328 to a 1x4 header along with GND and +5V as that would let me experiment with adding a LocoNet interface which might be interesting. I don't know how busy the Mega328 is running the DCC++ firmware already but could be useful.RegardsAlex Shepherd
So... I have a preliminary setup that would all fit onto the hat, giving you the following connections/interfaces:A schematic is available here: https://github.com/cescalemodels/BaseStationHAT/blob/master/Hardware/BoosterHC%20HAT%20V0_3.pdfBefore I go any further, I'd like to get a feeling for how much execution time that all of these peripherals require. Can anyone familiar with the code side confirm that the DCC++ interface, the OpenLCB interface, and the Loconet interface can all happen at the same time on a 16MHz microcontroller?
1) I had suggested connecting the LocoNet Rx to ICP because the UART on the Mega328 is already consumed and my existing code uses ICP so it can sense collisions etc. The FREMO guys made a version that uses the UART RX + ICP to be more efficient Receive but still bit-bashed the Tx to have tight control of the collision sensing. As the AT90CAN128 has multiple UARTS we can use RXD1 + ICP1 for LocoNet Rx now. The ICP1 would be used to detect LocoNet Start-Bit activity before the first byte is complete as part of the collision sensing required for LocoNet. We could use TXD1 for LocoNet Tx, but the polarity is wrong so need to have an inverter between TXD1 and Q1 Base. Another NPN to invert the signal might be enough.2) Having CAN also come into the AVR doing both DCC++ and LocoNet as well as CAN might be too much load - I don't know yet. You'd have to transfer the CAN data and the LocoNet data and the DCC++ data into the RPi via the UART0, which might be a bit of a challenge.LocoNet runs at 16K and the CAN Bus runs at 125K, so if both are running at max capacity then we need to communicate to the RPi at about 150k, so expand that to 230k if you add some extra protocol overhead bytes to multiplex each of the LocoNet, DCC++ and CAN to the RPi.
While we don't have a good idea of the execution time, I can say that the board layout is going to be VERY tight if I want to still be able to call this a HAT. I had to source and make up my own EAGLE part for the dual stacked 8p8c port, and since I couldn't find any stacked 6p6c ports I have to make those separate, but I will probably use a single side-by-side component because that'll save a tiny bit of space. I will also need to switch the package for the AT90CAN128 chip to a slightly smaller QFN one so I can cram it in a corner:As for cramming things into the execution time, I will put together a new schematic and hopefully get a board laid out for the prototype.
I'm nervous about cramming all this into a relatively (by current ARM standards) low powered AVR and having the various bits of data (OpenLCB CAN, LocoNet and DCC) all in the relatively low powered AVR.While the AVR may be able to receive all the data, its lacking RAM and CPU cycles to be able to do a lot of smart State and Event management as well as acting on that and generating actions based on control logic.You original design had the MCP2515 CAN interface alongside the DCC++ Mega328. The CAN data was going via SPI to the RPi and the DCC++ was just on the RPi UART and so they had separate data paths back to the RPi.The RPi has heaps of CPU cycles and RAM to handle all the State and Event management as well as Control Logic etc. It can maintain large lookup tables in RAM etc to gateway LocoNet and DCC to OpenLCB via the various mappings we've discussed over the years.So to me the previous design made more architectural sense. There is still a ? over the MCP2515 and how it handles CAN frame ordering and not missing frames etc, but that can be verified independently.
I did a little more research, the SAM3X8E is a little more spendy but it would have everything we need and more... 2 CAN controllers, plenty (5) of serial ports, lots (3) of 32-bit timers, lots of SPI's... just in general a lot of excess. It does operate at 3.3V but that's not a big deal. The clock speed is a whopping 86MHz. And arduino supports it with their AtHeart program. The question is, would this be helpful or would it just be adding extra cost without too much advantage? The big advantage I could see is all the expansion ports I could include to add extra cool interfaces later.David