week six Header Img

Week 6: The "Hello-World"-Board



This week the task was to redraw Neils Hello-World Board and add at least a LED and a button.
First to choose the CAD-Tool... As i am a user of Eagle for about 15 years and i´ve got a Pro-licence for another job this was a quick decision: Eagle.
Surely i should write now the next tutorial on how to use Eagle, but if you google "tutorial eagle" you find about 15.700.000 Pages. And i´m pretty sure that some of these are much much much more detailed than mine could be ;)

The Hello-World-Board is a tiny circuit with an AtTiny45, a pinheader for some uart, and maybe a button and a led. Properly it will end in garbage after the Fabacademy. AND there are hundreds of students that made exactly this board. Uh...

So lets make something new, the

... wait for it ...

FAB-PIC!

The Fab-Pic is a tiny circuit board that fints onto your Breadboard and it has a lot of power. The right board for the Tim Tailor in you, if you are bored about using Arduino for every task, no matter how easy or hard the Job is. The board with the components is abour 5$, less if you got some components in your reste crate. On the bottom of this page you can find the Eagle-Files for the board. In Week 8 i will explain how to program the board using the MPLAB-X IDE.

Eagle schematic Img
Eagle board Img


So, what you get for the buck... No, it is not a raspberry-pi-zero, and not this powerfull, but it is available ;)
The controller of the Fab-Pic is a PIC18F26K80. You can use any other 28-Pin-PIC18 if you want, this was just the type i had laying around here.
HINT: you can get free samples from microchip! Up to 6 ICs (also eeproms and so on) every 4 weeks. The samples are absolutely free of charge!
Next to the controller is a 8-Mhz Crystal with to 18pF capacitors. The ICSP-Interface is breaked out, there is a jumper for choosing the power-input (programer or external supply), a LED and a button. Every Pin that is not needed by the board itself is breaked out to your bread-board. These are 20 Pins!

Some facts to the 26K80:

  • You can use 1.8 to 5.5V as supply voltage
  • Speed is up to 64 MHz, but we use 8 or 32 with this crystal. If you want, you can use the internal osc and you get the fill 64 MHz
  • 64kb on-chip-flash
  • 1kb eeprom
  • you can implement a bootloader like on the arduino
  • 8-Channels of 12-Bit A/D
  • 5 Capture/Compare/PWM Pins
  • 2 8-bit-timers, 3 16-bit-timers
  • 2 UARTs
  • 2 analog comparatos
  • 1 CAN 2.0B Interface
  • 1 CMTU (to read in a PWM-Signal for example)

  • As you can see, this thing brings power to your breadboard...
    To program it, you need a programer. The cheapest i´ve found is the "PicKit 3" from Microchip itself.
    You can find it on amazon or every electronic-supply-store for about 30$.
    What you get is not just a programer but also a tiny debugger that can handle up to three breakpoints. Very usefull!!!



    Let´s explain the circuit:
    26k80 pinout Img This is the pinout of the 26k80. There are some pins that are not breaked out, due to the fact that these are only needed for programing, the oscilator and power-supply. But you get:
  • From the left-side: Pins 2,3,4,5,6,7,11,12,13 and 14
  • and from the right-side: Pins 26,25,24,23,22,21,18,17,16 and 15
  • Pins 8, 19 and 20 are used for the power supply. At the shortöedn of the Fab-Pic you will find two pins, Ground and Vdd.

    Pins 9 and 10 are used by the crystal. As you can see in the datasheets the Pic has a lot of configurations for the oscilator. Our Crystal has 8-MHz, but you can also use the internal PLL of the pic and get 32MHz out of it. Or you can use the build-in crystal which runs on 16 MHz, with PLL enabled you get 64 MHz out of it. So the right speed for every task...

    Pins 27 and 28 are used by the ICSP. Surely they can also be used by your circuit, but to these pins the LED (28) and the button (27) are connected.

    HINT: the LED is on RB7, the button on RB6

    Some words about the ICSP:
    Every Pic uses a method called "High-Voltage-Programing". This means, that the progamer tells the pic by a 12V-Signal on the MCLR-Pin that it has to go to a programing-state. The program itself is then send serial (clock and data) to the Pins 28 and 27.
    The problem is, that the MCLR-Pin is also the reset-pin and it has to be on high-level when the controler shall run.
    Because of this the MCLR is connected to VDD by a schotcky-diode and a resistor. This protects the circuit from the 12V of the programer.

    Second problem is the supply-voltage:
    The pickit can supply the circuit with up to 400mA out of your USB-port. But if you connect an external-supply and the pickit at the same time, it COULD bang your USB-Port. So i´ve placed a jumper next to the ICSP-Interface. With this you could choose which supply is used.

    ICSP Img
    Here you can also see the connection for the LED and the button. Be aware, that you don´t push the button while programing!

    And this is what the very first Fab-Pic looks like:
    fab-pic Img
    fab-pic with pic-kit Img
    fab-pic pinout Img


    I´ve made the board with our LPKF S63, our LPKF Pick-n-place and a reflow-oven. The process is explained already in week 4.
    If you want the eagle-files, here they are: fab-pic.zip

    To test the board i wrote a little program that just toggles the LED on and off by a button press. In week 8 we will have a assignment in "embedded programing", there i will explain the toolchain and some basic programs!

    Have fun!




    UPDATE: After some working with the fab-pic i´ve made some smaller changes:

  • The 10-Pin-Header on both sides is now a 11-Pin-Header. The two new pins are routed to GND and +5V (ICSP-Port upside, GND left, +5V right).
    The ICSP has now a shotky-diode in the 5V-Line. This way you can power the fab-pic external while the programmer is connected. With the jumper next to the icsp you can decide if the circuit is powerd by the programmer and your USB-Port or by an external source. Small circuits can be powered by the USB, but only up to 500mA!

    The button on the fab-pic has now an external pull-up. This works much better than the build-in one...

    The new Pin-Out:

    fab-pic v2 pinout Img

    Here are the eagle files: fab_pic_v2.zip

    So long, have fun!