Now for real, the circuit is finished, and I have started with assigning and creating the footprints for the components. There are no one major updates this week, but rather a lot of changes and modifications to the schematics. As usual, here is the visual diff for this week.

diff

Additions are in cyan, and deletions are in red. Now to the details.

Adding SPI flash memory

Originally, there was only microSD card connected to both the FPGA and the PIC18 microcontroller. This method proved to be a problem, so we decided to connect the SD card to the PIC18 only. This, as well, was not the best idea so now the SD card is connected to the FPGA only. The main purpose of the SD card was to store the bitstream needed to program the FPGA, and after configuration it can be used by the user. With this new setup, the PIC18 does not have an access to the card, hence, we added a simple 8-Mbit SPI flash memory to hold the bitstream.

You can see that the SD card has been removed (drawn in red) in the above visual diff, and the flash memory is in its place (in cyan). The SD card is not in the root sheet above, as it has been moved to the sheet containing bank 0 of the FPGA.

All connection of the PIC SPI module is now connected to the flash memory; and the additional memory connections – such as HOLD, and WP – are connected to port C of the microcontroller. Since the microcontroller is not connected to the FPGA with SPI anymore, there is no need for the slave select SS pin (BF7). This pin is now connected to the FPGA Awake pin to indicate when it exists SUSPEND mode.

The microcontroller interrupts

16FUSB project needs only one interrupt to work, whereas the other two connections can be any general purpose I/O port. Last week it was connected to three of the interrupts pins, which is a waste. That’s been changed so that D+ line is connected to INT1 pin, while D- and the third connection that indicate EOP are connected to PORT E.

The Arduino board has an external RESET pin connected to the MCLR pin so that shields and users can use it to reset the board. We implement that a slightly differently, as we connected the RESET pin to INT0 – which has the highest priority. This way we can control what happen when this pin is asserted. The INT0 is also connected to the FPGA as well, to enable it to reset the PIC if needed.

Two Interrupt-on-Change pins are already utilized for the ICSP connections. The rest of the interrupt pins are all connected to the FPGA directly.

PORT D and PORT E

After taking 2 pins of Port E to interface with the USB, only 3 pins left to connect to the FPGA (one pin is connected to the FPGA SUSPEND pin). PORT D “which is 3 pins only” was used for the FPGA dedicated programming pins. As advised by my supervisor, it is better to leave a complete port for communicating with the FPGA. Therefore, the FPGA programming pins has been changed to port E, and PORT D is now connected to the FPGA I/O pins for communication between the two.

Clearing Bank 1

The FPGA we are using has two Memory Control Blocks, one at Bank 1 and the other at Bank 3. My supervisor asked my to clear one of the memory control blocks of any connections so that in the future a memory can be added to the circuit without disrupting the current schematics connections. Since Bank 3 is closer to the digital ports, and because most of Bank 1 pins are multiplexed with other functions, I decided to clear Bank 1 and move all its connections to one of the other 3 banks. Now bank 1 is not connected to anything, except for the Awake pin which is not used in the MCB.

Connecting unconnected pins

The Arduino has 6 analogue pins, but since the PIC18 has 11 pins, we are designing the board with 6×2 header. However, only 9 of the 11 pins are connected, leaving 3 unconnected pins in the header. It would be a waste to leave them unconnected in the board, so we just connected them to the FPGA for the user to use.

Well, that’s it for the schematics. After starting with the PCB layout, there might be some changes, but hopefully those will be minor. The rest of the week, I worked on creating the Bill Of Materials for the board, and had to decide on the actual components to use for each of the schematics components. Once I finished the BOM, I started with creating the components footprints. For most components, I can use the KiCAD default library, but for components such as the microSD sockect, I need to create my own. This is the Micro-USB type B connector footprint I created for the one we are using.

micro_usb

And with that my friends, I finish the first step (creating the circuit schematics) and start the journey of creating the PCB layout. I have a lot to learn and discover, but I hope it won’t take long. Stay put, and talk to you next time.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.