ENCM511 Scope tutorial: Fall 2014

5
ENCM511 Scope tutorial: Fall 2014 Investigating some of the signals on the Blackfin SPI R. Thomson and M. Smith Purpose Embedded system engineers write code that talks to other code (software engineering) and code that talks to hardware (firmware engineering). When firmware engineers trouble shoot their code they are sometimes faced with having to use an oscilloscope to try and find out if the problem is caused by a software bug or a hardware fault, or both. This lab is an introduction on how one might use the scope to view serial peripheral interface wave form data to detect a bug in your software or possibly a hardware fault. Pre-Lab Reading Prior to coming to the lab, please read the following documents, for useful information for the lab. 1. Scope document, on lab bench 2. What is SPI?, http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus Equipment required You will be working in pairs for your groups. One in your group will use their student ID, to sign out the hardware bag for the duration of the lab. 1. ENCM511 Electronic Hardware bag. 2. 1 x Coax cable 3. 2 x (Scope probes x10) 4. Logic station 5. Assorted 22 gauge solid hook up wire. 6. Agilent DSO-X 3012A Scope 7. SPI Extender Board (Ver.1) 8. 160x128 TFT display board 9. Blackfin BF533 Evaluation Board 10. 50-pin cable Lab Proceedure Part 1 – Blackfin BF533 Evaluation Board Test 1. Find a 'lab partner for today (please use groups of 2) a) Odd Lab Sections– A301 Stations 1 – 16, A305 Stations 1 – 8 (3:30 pm to 5:00pm) b) Even Lab Sections – A301 Stations 1 – 16, A305 Stations 1 – 8 (2:00 pm to 3:30pm) 2. Log into the computer. 3. Power up the Blackfin processor the LED's should show this behavior.,as shown in Table 1 below Note:There are ten LED's they are numbered from one to ten with 1 starting on the left State Led Sequence Comments Next state 1 ~rqponmlku ~rqponmlvu ~rqponmwvu ~rqponmlku Turn on Blackfin, the LED's should follow this pattern. 2 2 ~rqponmlkj Push and hold SW1 3 3 ~rqponxlkj ~rqpoyxlkj ~rqpzyxlkj ~rqponxlkj After releasing SW1 the LED's should follow this pattern. 4 4 ~rqponmlkj Push and hold SW1, after release should repeat from state 1 1

Transcript of ENCM511 Scope tutorial: Fall 2014

Page 1: ENCM511 Scope tutorial: Fall 2014

ENCM511 Scope tutorial: Fall 2014Investigating some of the signals on the Blackfin SPI

R. Thomson and M. SmithPurpose

Embedded system engineers write code that talks to other code (software engineering) and code that talks to hardware (firmware engineering). When firmware engineers trouble shoot their code they are sometimes faced with having to use an oscilloscope to try and find out if the problem is caused by a software bug or a hardware fault, or both. This lab is an introduction on how one might use the scope to view serial peripheral interface wave form data to detect a bug in your software or possibly a hardware fault.

Pre-Lab Reading

Prior to coming to the lab, please read the following documents, for useful information for the lab. 1. Scope document, on lab bench2. What is SPI?, http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus

Equipment requiredYou will be working in pairs for your groups. One in your group will use their student ID, to sign out the

hardware bag for the duration of the lab.

1. ENCM511 Electronic Hardware bag.2. 1 x Coax cable3. 2 x (Scope probes x10)4. Logic station5. Assorted 22 gauge solid hook up wire.6. Agilent DSO-X 3012A Scope7. SPI Extender Board (Ver.1)8. 160x128 TFT display board9. Blackfin BF533 Evaluation Board10. 50-pin cable

Lab Proceedure Part 1 – Blackfin BF533 Evaluation Board Test

1. Find a 'lab partner for today (please use groups of 2)a) Odd Lab Sections– A301 Stations 1 – 16, A305 Stations 1 – 8 (3:30 pm to 5:00pm)b) Even Lab Sections – A301 Stations 1 – 16, A305 Stations 1 – 8 (2:00 pm to 3:30pm)

2. Log into the computer.3. Power up the Blackfin processor the LED's should show this behavior.,as shown in Table 1 below

Note:There are ten LED's they are numbered from one to ten with 1 starting on the left

State Led Sequence Comments Next state

1 ~rqponmlku~rqponmlvu~rqponmwvu~rqponmlku

Turn on Blackfin, the LED's should follow this pattern. 2

2 ~rqponmlkj Push and hold SW1 3

3 ~rqponxlkj~rqpoyxlkj~rqpzyxlkj~rqponxlkj

After releasing SW1 the LED's should follow this pattern. 4

4 ~rqponmlkj Push and hold SW1, after release should repeat from state 1 1

Page 2: ENCM511 Scope tutorial: Fall 2014

Table 1 Blackfin led sequencing

a) Check that the Blackfin processor LED's sequence works as described above. Why does it not work as expected?

b) Ghost of Joe Pillar (discussed in class) is said to wander the rows of A301 and A305 holding SW1 and stopping the LED's from flashing.

4. Solving the Joe Pillar-GHOST problema) Power down the Blackfin board.b) Check that the logic station is powered down.c) Insert the 50 pin cable between the Blackfin board and the logic station BF533 Remote Extender Board

CP1. Press till both ends go “click”d) Power up the logic station.e) Walk around your lab stool using the Mantra – “42 fixes everything” - walk around 3 times saying 42

(not 42 times saying 3 J)f) Power up the Blackfin.g) Recheck the sequence in table 1, does it work now?

a) Remember to scare away the ghost of Joe Pillar at the start of each lab.b) Quiz Question : Arthur C. Clarke in “Rendezvous with Rama” said “That the technology of

any significant advantaged technology will look like magic”. Obviously using clicks and mantras did not make the Blackfin work – so what did and why is it important to do the actions during all future labs?

c) Quiz Question: Show the pattern of the LED's expressed as a hex number 0x???

Lab Proceedure Part 2 Wireup SPIEB to Logic station and test LCD Screen 1. Pick up the ENCM511 Electronic Hardware bag.2. VERY IMPORTANT – Power down the Blackfin and Logic station before proceeding 3. Quick test – Blackfin LED's should stop flashing. Logic station board LED's should not turn on when

the yellow switches on logic lab are pressed.4. As shown in Photo 1, install the SPI Extender board (SPIEB) with the TFT LCD screen attached to the

BF533 remote extender board on CJ2. NOTE: verify that the SPIEB is correctly pin aligned to the BF533 before turning the power on the logic station.

Photo 1 TFT LCD installed with the SPIEB to the BF533 remote extender board

5. Connect a black-covered wire from the Blackfin extender board ground connectors to the Logic station Ground (Do this at the start of each lab)

6. Connect a black wire from the GND of the logic station to one of the two GND connector (CJ1) of the SPIEB.

7. Attach a black wire from the GND connector (CF1) on the SPIEB to the GND terminal on CJ4 of the BF533 Remote extender Board.

8. Connect a RED wire from the '+5v' of the logic station to one of the two 'VCC+5' connector locations

Page 3: ENCM511 Scope tutorial: Fall 2014

on CJ1 of the SPIEB. 9. See Photo 2 -Power hookup to SPIEB

Photo 2 Power hookup to SPIEB 10. Power up the Logic station and then the Blackfin. Does the sequencing work now?

Lab Proceedure Part 3 Scope hookup to SPIEB 1. Next we will connect up the Oscilloscope to the SPIEB, follow steps a through d.

a) On Channel 1 connect the probe to the red SCK test point.b) On Channel 2 connect the probe to the yellow MOSI test point.c) Connect one of the Black ground Clips of the scope probes to the GND Test point on the SPIEB.

(Only one of the two grounds from the probes need to be connected to the GND point).Quiz Question: Why do we only need to connect one of the two ground clips the GND test point on the SPIEB?

d) Attach a solid wire to PF6 on the SPIEB header, to one of 4 pin BNC headers on the logic station. Then connect a BNC cable on the logic station to the External Trigger on the back of the scope.

e) See photo 3 of what the wiring should look like, when completed.

Photo 3 Close up of Scope probe hookup, Note Power is not hooked up yet...

Page 4: ENCM511 Scope tutorial: Fall 2014

Lab Proceedure Part 4 S cope setup

1. Channel Setup a) Set Channel 1 (SCK) to Coupling=DC, Imped=1M Ohm, BW Limit=off, Fine=off, Invert=off,

V/div=2v/div, b) Set Channel 1 Probe as follows: Units=Volts, Probe=10.0:1, Skew=0.0sc) Repeat same settings above for Channel 2.

2. Trigger Setup a) Set trigger to Trigger Type = Edge, Source=EXT, Slope = Falling edge.b) Set Mode/Coupling as follows: Mode=Normal, Coupling=DC, Noise Rej=off, HF Reject=off,

Holdoff=40.0ns, (External tab). Units=Volts, Probe=1.00:1c) Adjust the Trigger Level to 2.50v

3. Horizontal Timebase Setup a) Set Timebase to 5us/div, Horizontal delay = 20us

4. If the Trigger is set correctly you should see the MOSI data and the Clock in sink, see Photo 6. (Note you may have to hit the 'RUN/STOP' button to get a good display.)

5. You will notice on Photo 5, that there is a small solid yellow triangle, (circled in green) just below the channel v/div, this is the Horizontal delay location. This is where the *CS goes H->L.

6. There are 5 SPI signals going from the Blackfin to the LCD display they are:a) SCLK – Signal used to clock in data on either the rising or falling edge.b) MOSI - (Master Out Slave In) Data pin from the Blackfin to the device(s)c) MISO – (Master In Slave Out) Data from device to Blackfin.d) *CS – Chip Select pin, in this case it is shown as active low comes from the Blackfine) D/*C – Data/*Command – This comes from the Blackfin to indicate if the data on MOSI is Data or a

Command.

Lab Proceedure Part 4 SPI Measurements 1. Look at the relationship between the *CS and SCK. Sketch a timing waveform of what you are seeing,

record time it takes from when *CS going low to start of SCK. 2. What is the period of the SCK?, Is the duty cycle of SCK equal?3. How long is the *CS staying LOW?4. Looking at SCK (L->H) and MOSI, Determine what the data is for the three colors, ie from Photo 5, one of

the colors is 0x06, 0x60. What is the data for the other two colors?5. For one of the colors sketch the timing relationship between the SCK and MOSI.

Photo 5

Page 5: ENCM511 Scope tutorial: Fall 2014

6. On the ADSP-BF533 panel push SW1, until the code sequence changes, then release SW1.7. Repeat steps 5 above. Does the display still work? Please explain why the display quit working.8. Push SW1 again to return the display to normal operation.