• The System

    Santiago10/24/2020 at 03:55 0 comments

    After taking care of the power lines, decoupling capacitor and power supply related things, the main components are connected as shown:

    For the matrix keyboard only 10 GPIO were used. Four are used for scanning and six for reading. The entire scan sequence was automated using the DMA capabilities of the micro controller. The only task done by software is the decoding of the input data.

    For the LCD the SPI hardware was used for the communication, and two additional GPIO were for data/command and reset. Like the keyboard, the transfer of graphics data through SPI were automated using DMA. With this the programmer can write all he need in the dedicated graphics memory at any moment and the DMA is going to transfer it to the LCD. At certain point, this is like a linux frame buffer.

  • The Hardware

    Santiago10/20/2020 at 05:14 0 comments

    There are three key components in a calculator:

    • Display, to show the results
    • Microcontroller, to do all the calculus
    • Keyboard, to input the values and operations

    There are other components like voltage regulators, battery chargers, on/off circuits but this project is focused only in building a calculator, it doesn't need to be standalone.

    The Display

    Lets start with the display, it had to be able to show a reasonable number of digits plus the signs, decimal point and exponent of scientific notation. I considered using small 7 segment displays, but I couldn't get them because nobody in my area sold them, and I couldn't import them either. That's why i choose the nokia 5110 lcd display.

    It has 48x84 pixels, and if we use 8x6 pixel characters we end up with a display of 6x14 characters. That's a good ammount of characters.

    It uses a SPI compatible serial communication protocol. And with two more GPIO the microcontroller was able to configure parameters like contrast and send all the graphics data.

    The Microcontroller

    I used a stm32f030r8 as the main microcontroller. It's a simple ARM cortex-m0 with no floating point unit. It has 64K bytes of flash memory and 8K bytes of ram. But it also has other interesting features, like SPI, USART, Timers, and Direct Memory Access (DMA) that I used in the graphics and the matrix keyboard.

    This micro comes in a LQFP-64 package. A pcb was made to adapt the smd pins to a "DIP" format.

    The Keyboard

    I made a 6x4 matrix keyboard for this calculator. The switch push button is 6x6mm and the pcb is 70x50mm.

    I also made a layout with paper and transparent tape, to know the meaning of each key and avoid noise on the exposed copper traces.

    With the extra keys I added more functionalities like the '//' parallel (for impedance), '+-' change sign (unused), 'Fun' for functions and Enter. Only the parallel is implemented. In the key 'B' a inverse function was coded.

    These are the main components used in the project. In the following logs I'm going to explain how all the pieces interact with each other and how the behavior was defined.

  • The Begining

    Santiago10/20/2020 at 03:09 0 comments

    Once upon a time, I wanted an programmable scientific calculator. Why? that's simple, I wanted some device with limited resources where I could learn how to write efficient and elegant code.

    But, those kind of calculator were and are still expensive. So, if i can't afford one, I'm going to build one.  Soon after, I realized the magnitude of the project, so I decided to build something simple but yet challenging.  And after some research about old scientific calculators I came across into the Sinclair Scientific. It really amazed me how despite the small amount of resources, Sinclair was able to build a scientific calculator. With only two value registers, RNP input and limited accuracy but yet functional. This set the reference design for the project, and with that in mind I started to make a component list.

    I have to say, after choosing the Sinclair Scientific as the form factor I was even more motivated after seeing reproductions of the calculator based on Arduino.

    The Sinclair Scientific and a reproduction made by Arduino Enigma (Link to his project).