fredag 23 december 2016

Documentation like a pro, SPI and Oscilloscope

Wednesday and Thursday I looked at GPIO and tried to send some signals to a PCB called MCP2515. It didn't send any signals and didn't do anything when I sent it some signal.

SPI

Then I took a look at SPI on wikipedia and what it uses MISO, MOSI, CE and CLK for. They're connections on the R-pi.

Documentation like a pro

I also started to document everything really neat. Since all this electronics and hardware close programming is very new to me and I can't learn fast enough or keep everything in the head, I needed to document somehow what I did. This helps me know:
  • what tutorials i used
  • what I have done to the system, in what order
  • what the problems where on the way
  • how I've solved the problems
The way I did this was like this (mixed swedish and english, I should probably choose just english):



I made a folder called "Changes on R-pi" and made a document for each separate thing/user story I tried to get working. The picture shows 2 Tutorials and how I started using another tutorial after I got stuck with the first one.
  1. Title: title of tutorial
  2. Link: to tutorial
  • commands done in linux (raspbian) 
  • Swedish text: Comments and guiding like "I didn't install 'wheezy' or 'Couldn't find the file, so I jumped to the next tutorial'
  •  Table: Error/result output messages
I'm quite pleased with this system. I can easily find any information about what I have done previously, so I don't have to keep anything in my head at all.

Ofcourse it migth take time to work like this but I think it's worth it in the long run. I will become a master of all of these things faster.

Digital oscilloscope

Me and Magnus used a digital oscilloscope to measure output and input on the SPI on the connections between R-pi and MCP2515.

Larm at the top, connected to Oscilloscope to show graphs about SPI signals. My laptop remotely running SPI-scripts on the R-pi in the Larm at the top.

I'm really happy that we could read signals from the R-pi, that probably means I did something right. And we found that the PCB isn't responding anything (just zeroes), we think it might be broken or that we're missing something...

CANUSB
The system uses CAN and connects to R-pi via the PCB right now. There are these cord converters from CAN to usb that we might use instead of the PCB. In a way it seems simpler.

Today I'm working from my home, noone is in the office. This gave me some time to do Falun gong but I can't work very well with the system. But I borrowed a R-pi home and am going to rehearse what I've done by setting it up just to try, read up on CANUSB and maybe try to communicate a bit differently to the PCB.

Inga kommentarer:

Skicka en kommentar