Keeping the Sheep Corralled An engineer, a physicist, and a mathematician are shown a pasture with a...
-
Upload
rylie-lipp -
Category
Documents
-
view
216 -
download
3
Transcript of Keeping the Sheep Corralled An engineer, a physicist, and a mathematician are shown a pasture with a...
![Page 1: Keeping the Sheep Corralled An engineer, a physicist, and a mathematician are shown a pasture with a herd of sheep, and told to put them inside the smallest.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5517810b5503460e6e8b5490/html5/thumbnails/1.jpg)
Keeping the Sheep Corralled
An engineer, a physicist, and a mathematician are shown a pasture with a herd of sheep, and told to put them inside the smallest possible amount of fence.
The engineer is first. He herds the sheep into a circle and then puts the fence around them, declaring, "A circle will use the least fence for a given area, so this is the best solution.“
The physicist is next. She creates a circular fence of infinite radius around the sheep, and then draws the fence tight around the herd, declaring, "This will give the smallest circular fence around the herd.“
![Page 2: Keeping the Sheep Corralled An engineer, a physicist, and a mathematician are shown a pasture with a herd of sheep, and told to put them inside the smallest.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5517810b5503460e6e8b5490/html5/thumbnails/2.jpg)
Keeping the Sheep Corralled
The mathematician is last. After giving the problem a little thought, he puts a small fence around himself and then declares, "I define myself to be on the outside!"
![Page 3: Keeping the Sheep Corralled An engineer, a physicist, and a mathematician are shown a pasture with a herd of sheep, and told to put them inside the smallest.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5517810b5503460e6e8b5490/html5/thumbnails/3.jpg)
Liquid Crystal Display
Embedded Systems Interfacing Laboratory
Timing, timing, timing …
![Page 4: Keeping the Sheep Corralled An engineer, a physicist, and a mathematician are shown a pasture with a herd of sheep, and told to put them inside the smallest.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5517810b5503460e6e8b5490/html5/thumbnails/4.jpg)
Overview Task 1 – Prelab Task 2 – initPMP & _10usDelay Task 3 – Instruction Sequence and
initLCD Task 4 – Application
initPMP initLCD cmdLCD putLCD main
![Page 5: Keeping the Sheep Corralled An engineer, a physicist, and a mathematician are shown a pasture with a herd of sheep, and told to put them inside the smallest.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5517810b5503460e6e8b5490/html5/thumbnails/5.jpg)
LCD Interface
8-bitDataBus
3-bitControl
Bus
10k
PIC Header
PMD7(RE7) PMD6(RE6) PMD5(RE5) PMD4(RE4) PMD3(RE3) PMD2(RE2) PMD1(RE1) PMD0(RE0)
PMWR(PD4) PMRD(RD5)
PMAO(RB15) VEE
14 13 12 11 10 09 08 07 06 05 04 03 02 01
Tianma TM162JCAWG1
1.3k
![Page 6: Keeping the Sheep Corralled An engineer, a physicist, and a mathematician are shown a pasture with a herd of sheep, and told to put them inside the smallest.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5517810b5503460e6e8b5490/html5/thumbnails/6.jpg)
LCD Interface
8-bitDataBus
3-bitControl
Bus
PIC Header
PMD7(RE7) PMD6(RE6) PMD5(RE5) PMD4(RE4) PMD3(RE3) PMD2(RE2) PMD1(RE1) PMD0(RE0)
PMWR(PD4) PMRD(RD5)
PMAO(RB15) VEE
14 13 12 11 10 09 08 07 06 05 04 03 02 01
Lumex LCM-S01602
![Page 7: Keeping the Sheep Corralled An engineer, a physicist, and a mathematician are shown a pasture with a herd of sheep, and told to put them inside the smallest.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5517810b5503460e6e8b5490/html5/thumbnails/7.jpg)
LCD Controller (SK00321)
Tianma TM162JCWAG1
16 Cols x 2 Lines
SK
0032
PIC24FJ128
1 Hitachi HD44780U Compatible Controller/Driver
![Page 8: Keeping the Sheep Corralled An engineer, a physicist, and a mathematician are shown a pasture with a herd of sheep, and told to put them inside the smallest.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5517810b5503460e6e8b5490/html5/thumbnails/8.jpg)
LCD Controller (S6A00691)
Lumex LCD-SO1602
16 Cols x 2 Lines
S6A
0069
PIC24FJ128
1 Hitachi HD44780U Compatible Controller/Driver
![Page 9: Keeping the Sheep Corralled An engineer, a physicist, and a mathematician are shown a pasture with a herd of sheep, and told to put them inside the smallest.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5517810b5503460e6e8b5490/html5/thumbnails/9.jpg)
Parallel Master Port (PMP) Configure
PMCON PMMODE PMADDR PMAEN
See Prelab for suggested bit patterns
![Page 10: Keeping the Sheep Corralled An engineer, a physicist, and a mathematician are shown a pasture with a herd of sheep, and told to put them inside the smallest.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5517810b5503460e6e8b5490/html5/thumbnails/10.jpg)
Control Signal R/W’ – Read/Write’ Select Signal RS – Register Select
0 = Instruction Register on write and Busy Flag on read
1 = Data Register on read and write E – Enable Signal Check waveforms to make sure
your values for WAITB, WAITM, and WAITE meet timing requirements of LCD
![Page 11: Keeping the Sheep Corralled An engineer, a physicist, and a mathematician are shown a pasture with a herd of sheep, and told to put them inside the smallest.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5517810b5503460e6e8b5490/html5/thumbnails/11.jpg)
WAITB, WAITM, and WAITE If WAITM = 0b0000, then WAITB
and WAITE have no affect Else WAITM 0b0000, then
WAITB, WAITM, and WAITE have an affect
WAITM x Tcy(WAITB+1) x Tcy (WAITE+1) x TcyE
Stable
![Page 12: Keeping the Sheep Corralled An engineer, a physicist, and a mathematician are shown a pasture with a herd of sheep, and told to put them inside the smallest.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5517810b5503460e6e8b5490/html5/thumbnails/12.jpg)
Delays – Task 2 – MPLAB SIM msDelay – Already in Peripherals.H
Change msDelay scale factor to 333L _10usDelay(unsigned char n){
unsigned char count;
for(count=n*usSCALE;count>0;count--){asm(“nop”);. . . . .}
}
![Page 13: Keeping the Sheep Corralled An engineer, a physicist, and a mathematician are shown a pasture with a herd of sheep, and told to put them inside the smallest.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5517810b5503460e6e8b5490/html5/thumbnails/13.jpg)
Task 2
Hello world
Via holes and LCDpins have different signalpin outs.
MSO
Explorer-16
Check PMP timing against data sheet
![Page 14: Keeping the Sheep Corralled An engineer, a physicist, and a mathematician are shown a pasture with a herd of sheep, and told to put them inside the smallest.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5517810b5503460e6e8b5490/html5/thumbnails/14.jpg)
Instruction Sequence – Task 3
![Page 15: Keeping the Sheep Corralled An engineer, a physicist, and a mathematician are shown a pasture with a herd of sheep, and told to put them inside the smallest.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5517810b5503460e6e8b5490/html5/thumbnails/15.jpg)
Instruction Execution Times Power-On Delay >30 ms (100 ms) Slow Instructions ( > 1.35 ms)
Clear display Home cursor
Fast Instructions (> 43 us) All other commands and data
![Page 16: Keeping the Sheep Corralled An engineer, a physicist, and a mathematician are shown a pasture with a herd of sheep, and told to put them inside the smallest.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5517810b5503460e6e8b5490/html5/thumbnails/16.jpg)
Functions – Task 3 initLCD – Initialize
LCD Main
initPMP initLCD Endless loop with
Nop( )
![Page 17: Keeping the Sheep Corralled An engineer, a physicist, and a mathematician are shown a pasture with a herd of sheep, and told to put them inside the smallest.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5517810b5503460e6e8b5490/html5/thumbnails/17.jpg)
Warning On Task 4 Task 3 may have
confused the LCD controller
Turn off power to Explorer-16 board.
Turn on power to Explorer-16 board
Debugger | Connect Reset Run
ResetLCDController
![Page 18: Keeping the Sheep Corralled An engineer, a physicist, and a mathematician are shown a pasture with a herd of sheep, and told to put them inside the smallest.](https://reader035.fdocuments.in/reader035/viewer/2022062619/5517810b5503460e6e8b5490/html5/thumbnails/18.jpg)
Functions – Task 4 putLCD – send character to LCD cmdLCD – send new command to
LCD Main
initPMP and initLCD Endless loop
Send message to display using putLCD Home cursor or clear display using cmdLCD