top of page
ECE153B
Group members:
Bindu Kashyn, Anna Ivannikova, Vanessa Mejia

CALCULATOR

Week 1:

This week, we decided on which components we want to use for our calculator. For inputs, we are going to be using a Digilent Keypad (PmodKYPD). The keypad will take in the numbers and operations from the user. For output we are going to use an Adafruit LCD display (E218213). This is where we are going to output the answer for the calculation that the user chose. The components should arrive by the end of the week.

Week 2:

We started trying to connect the keypad to the LPC4088 board. The keypad is going to need 8 GPIO pins, 2 grounds, and 2 Vcc. We started by connecting our columns to the GPIO pins. Right now we are having trouble reading from the pins.  

Week 3:

The problem that we have been facing for a while is the fact that the GPIO pins do not all work with the board which is very weird because they should all be available for use. We had to go pin by pin and find 8 pins that were fully functioning and this was tedious but we were able to finally some, but not all. 

After, several days of struggling with the pins, we were able to make the columns partially work. We also connected the rows and started trying to make them work. We also began working on the code for the LCD display. 

Week 4:

We finally got two columns and three rows to work so we began focusing on the implementation of the calculator. We were able to make the buttons for number 2, 3, 5, 6, 8, 9 work. The user will push two of those buttons to select the number and since we had limited buttons we had to reuse the numbers to act as an operator if pressed a third time. The third press is the operator that should be carried out, we have buttons 6, 8, or 9 respectively to add, subtract, or multiply those two numbers. If the user selects a third number that is not 6, 8, or 9 the output will prompt the user to try again until a correct number is chosen for the operator.

Week 5:

This week we shifted our entire focus to outputting our calculations. We decided to not use the LCD screen because of the problem with our faulty pins. Instead, we are going to be outputting on Termite using UART. We were able to complete the code but we encountered a problem of having 2 overlapping pins that UART is automatically assigned to (GPIO 16 and 17). We have to go back and find 2 different working pins that are not connected to UART and connect them to these instead of using GPIO 16 and 17.

Final Day:

Today we met earlier than our scheduled demo time because we had to get our data to output on Termite. We were able to find different pins for the conflicting pins. After finding the pins, there were just some formatting issues that had to be fixed but we got the output to display correctly on Termite. Our demo went well and this concluded our project. 

 

Demo of final project: 

Problems we encountered:

The biggest and most time consuming problem we encountered was that the GPIO pins were not working. We spent a lot of time trying to debug our code because we assumed that our board was not the problem, according to the data sheet all of the pins should be available for use. We went through most pins in port 0 which was the port we needed and most of them did not work. We were able to verify that it was the GPIO pins because we connected the column we knew was working to new pins in order to find some that were working. We found that when we did this, the column no longer worked, this is what made us confident to say that the GPIO pins were at fault, not our logic. We also measured the output voltage of the keypad pins and it was almost 0 for two columns and one row when it should be at 3.3V. So we understood that it was also our keypad that was not functioning completely. We had to change our output method as well because the LCD would require more GPIO pins as well and there were not enough working ones for us to use. This is why we changed to outputting on termite with UART instead of the LCD screen. 

Another problem we encountered was with IOCON. We found that the IOCON API function in the library did not work - we tried setting the IOCON registers of our GPIO pins to "Func0" and "Pulldown" but saw that it was not performing this function. We fixed this by looking for the address of these IOCON pins on the manual and then manually assign the pulldown and func0 to these address pointers.

   

What we learned:

This project was a great learning experience for all of us because it helped us learn more about the board. We were able to overcome the problems we encountered. One of the main purposes of this project was for us to learn how to use and find information on data sheets. For example, to set up GPIO pins we had to look through 3 separate data sheets. Another purpose was for us to get more debugging experience with this board, we definitely got a lot.

Overall, we are very proud to have gotten the functionality of the project done, even though we had hardware problems we were still able to show a functioning calculator which was the point of our project. 

     

bottom of page