Once the Fake EPROM experiments were completed, it was time to design new circuit board. The first version of the new Version 4 board was defined to be 4V0.
Big changes were in order for this new board. I have made lots of circuit boards before, but I always assemble the parts onto them myself. This time, the RP2040 processor I was using was going to be beyond my ability to reliably solder down to the circuit board. Fortunately, JCLPCB has a service where they will professionally solder down any parts that you want that they stock. Even more fortunately, they stock the RP2040!
Having never made a board before to be assembled at JLCPCB, it took a bit of extra time. The most tedious part was identifying parts available from LCSC that could be used in the design. For the most part, the process went smoothly at JCLPCB. The only issue was that I had stupidly assumed that the NOR flash chip in the SOIC-8 package was in fact, a standard SOIC-8 package. I got a note back from the engineers at JCLPCB that the NOR flash chip did not fit on my footprint. They were right, too. It turns out that my new NOR flash uses an SOIC-8 209mil package. Somehow, I totally missed that when reading the data sheet.
I found a proper footprint for the 209mil version of an SOIC-8 on the web, changed my footprint and resubmitted the design. The beauty of the footprint error was that while laying awake at night imagining what I might have done wrong with the design, it occurred to me that I was using the secondary wifi processor to control the RESET signal that would allow the ECU processor to run or not. That's fine, but what it means is that one more device needs to work for the motorbike engine to run. It occurred to me that the fake EPROM should be the thing that controls the ECU RESET. As soon as the fake EPROM is ready to respond to ECU processor bus cycles, it should allow the ECU to run. That way, a weird software bug in the wifi processor would not leave me stuck at the side of the road.
Making the RESET change turned out to be as easy as adding a single wire to the schematic, so I slipped the new wire in while fixing the NOR flash footprint. And of course, I added a little letter 'b' in the version ID "4V0b" that will get silkscreened onto the board. I have learned the hard way to make some sort of obvious change to every single board that I send to a fab house. That allows me to confirm 100% that I shipped the proper set of design files to the fab house. Believe me, it is possible to make One Final Change and then send off the wrong fileset. After submitting the new fileset, I verified that the new files contained the little letter 'b' in the version number, as well as my new trace to allow the RP2040 to control the ECU RESET signal.
The photo below is the one sent back to me by the engineers at JCLPCB to confirm the orientation of the parts on my board. The whole "orientation" thing is very, very tricky. Parts come on reels. The manufacturer typically (but not always!) will have a section in the data sheet for a part where they show the orientation of the part as it arrives on the reel. But different manufacturers may have different orientations for the same part numbers as other manufacturers. It is a potential morass of chances to get your chips installed backwards.
Fortunately, JCLPCB takes care of this using a surprisingly manual process. Hey, I'm not complaining - their manual process sure makes my life easier. Here's how it works: They get an engineer to look at my circuit board and examine any components that may have orientation choices. Their engineer basically discards any orientation info I give them as part of my database. They look at the markings on my silkscreen, compare it to their information about how their parts sit in their own reels, and they take care of modifying my files so that the orientations are correct. Then they generate a picture of the board with 'parts' mounted on the board as per their orientation changes. Specifically, they add little red dots on the picture to indicate the pin 1 location. On my boards, I use little white triangles on the silkscreen to mark the same info. Also, some component like diodes need to go on the board in a specific orientation to work properly. I marked my board with little while '+' symbols to mark the positive end of the diodes, and the JCLPCB engineers marked the diagram with little red '+' signs. Again, the red and white '+' symbols need to be at the same ends, and all will be good. There are also pin 1 indicators for transistors Q1 and Q2, but they are pretty pointless because it is impossible to get their orientation incorrect because they are 3-pin devices. Even so, the red dots need to line up with the white triangles.
So basically, I need to check the engineer's manual orientation work by verifying that there is a red dot beside each white triangle and that there is a red '+' by all of my silkscreened '+' signs. Everything looked good as shown below, so I clicked the button on their website to release it to production.
And just like that, the production process kicks into high gear. Their website shows where the board is in the process at any given time so I can track how things are going at each stage.
The totally crazy part is that to get 5 circuit boards built, populated with parts, and then shipped via DHL 2-day service was a grand total of $80 (not including a $9 off coupon). The other choice would be to have 5 PCBs fabricated but only 2 of them assembled. That would have been $12 cheaper. So blew the extra $12 and got all 5 assembled . If I were to blow one up during testing, it would not be a disaster.
I submitted the files on a Wednesday morning at 8AM PDT, or 11PM in China. They started working on things first thing in the China morning while I was eating dinner. The boards were through the PCB fabrication process in just over 24 hours. It would appear that when you use JCLPCB's assembly process, the PCBs are fabricated at a special factory where they do both PCB fab and assembly. That means that the bare PCBs don't need to get shipped anywhere for the assembly phase. Sure enough, the assembly process began 11 hours after the PCBs exited their final inspection phase. The assembly and reflow operations only took 2 hours. I am hoping that the boards get shipped on China's Monday morning (my Sunday evening). Maybe I will have them by Thursday this week.
Will they work? Historically, when discussing the first version of any new board I make, the answer is usually "mostly", but hardly ever "perfectly". I don't think I have ever made an initial board that ended up being the final product. I always learn a thing or two along the way which I incorporate into an improved version.The original boards really just need to work well enough to make significant progress in the hardware and software sense to teach me some important lessons for the next design spin. Besides, I love making circuit boards. The most versions of a PCB I ever made was 5 for my AC Current Monitor project. Who knows how many there will be for this project. In regards to this first version of the new design, I would be satisfied if this board could meet the following goals:
A functioning debug mechanism for the RP2040
A properly emulated EPROM capable of fooling the ECU's HC11. This will require:
working voltage conversion mechanisms
proper read/write bus direction switching mechanisms
Functional RESET control for the ECU processor
Bonus points would be awarded for the following:
A working RP2040 USB connection to allow for RP2040 software upgrades without needing a debugger
A working Raspberry Pi Pico W WiFi controller board that has functional control over the following subsystems:
RP2040 communication mechanism
In the end, it took two weeks to get the boards back. They got stuck for a while within a few miles of my house. But I did finally get them!
Next up: Board Bringup!