jx-2pPlus

Page 1

JX-2P plus : i-Stamp2P Project board l 1

JX-2P plus : i-Stamp2P (OEM BASIC Stamp2P40) Project board

ºÍà ´¾Ñ²¹Òâ¤Ã§§Ò¹ÊíÒËÃѺ i-Stamp2P 1. ¤Ø³ÊÁºÑµ·Ô ҧ෤¹Ô¤ Áդ͹à¹ç¡àµÍà µÇÑ àÁÕ 40 ¢Ò ÊíÒËÃѺµÔ´µÑ§é i-Stamp2P l àª×Í è Áµ ͡Ѻ¤ÍÁ¾ÔÇàµÍà ¼Ò ¹¾Íà µÍ¹Ø¡ÃÁ RS-232 (ËÒ¡¤ÍÁ¾ÔÇàµÍà ÁàÕ ©¾ÒоÍà µ USB µ ͧ㪠µÇÑ á»Å§ USB à» ¹¾Íà µÍ¹Ø¡ÃÁ á¹Ð¹íÒÃع UCON-232S) l ÁÕ¨´ Ø µ Í¢Ò¾Íà µ¢Í§ i-Stamp2P ÍÔÊÃÐ 24 ¢Ò (P0 ¶Ö§ P15 áÅÐ A0 ¶Ö§ A7) l ¨Ñ´ÊÃâҾÍà µ P0 ¶Ö§ P7 à» ¹¤Í¹à¹ç¡àµÍà JST ÊíÒËÃѺµ ͡Ѻἧǧ¨ÃʹѺʹعáÅеÑÇ µÃǨ¨Ñº¢Í§ INEX l ¨Ñ´ÊÃâҾÍà µ P13 ¶Ö§ P15 ÊíÒËÃѺàª×Í è Áµ ͡Ѻ RC à«Íà âÇÁÍàµÍà ¢¹Ò´àÅç¡ â´ÂÁÕ¨´Ø µ Íä¿àÅÕé§ÊíÒËÃѺà«Íà âÇÁÍàµÍà ᡵ Ò§ËÒ¡ l ¨Ñ´ÊÃâҾÍà µ A8 µ ͡Ѻ DS18B20 äÍ«ÕÇ´ Ñ ÍسËÀÙÁáÔ ººÃкººÑÊ˹֧è ÊÒ ·íÒãË ÊÒÁÒ Ã¶·´Åͧ¡ÒÃ㪠§Ò¹ i-Stamp2P ¡ÑºÍØ»¡Ã³ ÃкººÑÊ˹֧è ÊÒÂä´ ·¹Ñ ·Õ l ¨Ñ´ÊÃâҾÍà µ A9 ¶Ö§ A15 µ ͡Ѻ¤Í¹à¹ç¡àµÍà ÊÒí ËÃѺâÁ´ÙÅ LCD ãª ä´ ¡º Ñ âÁ´ÙÅ LCD ¢¹Ò´ 8 µÑÇÍÑ¡Éà 2 ºÃ÷Ѵ¨¹¶Ö§ 16 µÑÇÍÑ¡Éà 4 ºÃ÷Ѵ á¹Ð¹íÒãË ãª ¡ºÑ ¢¹Ò´ 16 µÑÇÍÑ¡Éà 2 ºÃ÷Ѵ l ÁÕÊÇÔµª RESET l ÁÕ¨´ Ø µ Íä¿àÅÕÂé § 2 ¨Ø´ (1) ¨Ø´¨ ÒÂä¿àÅÕÂé §ÊíÒËÃѺ i-Stamp2P à» ¹á¨ ¡ÍÐá´»àµÍà áÅÐà·Íà Á¹Ô ÍźÅçÍ¡ 2 ¢Ò ÃͧÃѺä¿àÅÕÂé § +6 ¶Ö§ 12V ¾Ã ÍÁÊÇÔµª à» ´-» ´ ÁÕǧ¨Ã¤Çº¤ØÁä¿àÅÕÂé §¤§·Õè +5V ÁÕä¿áÊ´§ÊÀÒÇÐä¿àÅÕÂé § (2) ¨Ø´¨ ÒÂä¿àÅÕÂé §ÊíÒËÃѺà«Íà âÇÁÍàµÍà ໠¹à·Íà Á¹Ô ÍźÅçÍ¡ 2 ¢Ò ÃͧÃѺä¿àÅÕÂé § ã¹Â Ò¹ +4.8 ¶Ö§ 6V ¾Ã ÍÁÊÇÔµª à» ´-» ´ áÅÐÁÕä¿áÊ´§ÊÀÒÇÐä¿àÅÕÂé § l ¾×¹ é ·ÕÊè Òí ËÃѺ¾Ñ²¹Òǧ¨ÃËÃ×Í Proto area ¢¹Ò´ 8.5 x 5.5 ૹµÔàÁµÃ ÊÒÁÒöµÔ´µÑ§é ἧµ Í Ç§¨ÃËÃ×ÍàºÃ´ºÍà ´¢¹Ò´àÅç¡ä´ ÁÕ¨´Ø ºÑ´¡ÃÕ·§Ñé ẺÃÐÂÐË Ò§ 100 ÁÔÅ ËÃ×Í 2.54 ÁÔÅÅÔàÁµÃ áÅÐ 80 ÁÔÅ ËÃ×Í 2 ÁÔÅÅÔàÁµÃ à¾×Íè ÃͧÃѺ¡ÒõԴµÑ§é ÍØ»¡Ã³ ÊÁÑÂãËÁ ·ÁÕè ÃÕ ÐÂÐË Ò§¢Í§¢ÒÍØ»¡Ã³ ËÅÒÂẺ l ¢¹Ò´ 9.5 x 13 ૹµÔàÁµÃ l

ã¹ÃÙ»·Õè 1 áÊ´§Ç§¨Ã¢Í§ºÍà ´ JX-2P plus Ê Ç¹ÃÙ»·Õè 2 áÊ´§Ê ǹ»ÃСͺ¢Í§ºÍà ´ JX-2P plus


2 l JX-2P plus : i-Stamp2P Project board

K3 Battery input

+Vin 6-16V

C4 47µF 16V

SW1 POWER

K4 +Vin DC input 7.5-16V

~ ~

IC1 2940-5.0

+ C1 220µF 25V

C2 0.1µF 63V

-

K5 SERVO supply +Vm 6-7.2V

+5V LED1 POWER R1 510

C3 0.1µF 63V

C8 2200µF 10V

SW2 SERVO_POWER

LED1 POWER R3 1k

+Vm

C7 0.1/50V

BD1 1A50V

+5V 37

C5 0.1/50V

C6 0.1/50V

K1 RS-232 (RJ-11 female)

1 2

+5V

3 4

PORT

i-Stamp2P Socket

39

GND MCU port

38

S1 RESET

A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0

P15 P14 P13 P12 P11 P10 P9 P8 P7 P6 P5 P4 P3 P2 P1 P0

36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21

20 19 18 17 16 15 14 13 12 11 10

A7 A6 A5 A4 A3 A2 A1 A0 +5V R2 2k2

2 #

2 "

2 !

2

2

2

9

8

7

6

5

P9 P8 P7 P6 P5 P4 P3 P2 P1 P0

!

J5 P4

,$

,# ,%

VR1 BRIGHT.

49

45

J2 P1

J4 P3

+5V

,"

J1 P0

J3 P2

i-Stamp2P PORT

IC2 DS18B20

K2 UIC-LCD

+5V

J6 P5

DS18B20

J7 P6

+5V

-

J8 P7

GND DQ +V

P13 +Vm GND P14 +Vm GND +Vm

P15 +Vm GND SERVO PORT

ÃÙ»·Õè 1 ǧ¨ÃÊÁºÙó ¢Í§ JX-2P plus ºÍà ´¾Ñ²¹Òâ¤Ã§§Ò¹´ Ç i-Stamp2P


JX-2P plus : i-Stamp2P Project board l 3

¨Ø´µ Íä¿àÅÕÂé §¨Ò¡áºµàµÍÃÕè ᨠ¡µ ÍÍÐá´»àµÍÃ

µ ;Íà µÍ¹Ø¡ÃÁ

µ ÍâÁ´ÙÅ LCD

»ÃÑ º ¤ÇÒÁªÑ ´ ਹ¢Í§ ¨ÍáÊ´§¼ÅâÁ´ÙÅ LCD ¨Ø ´ µ Í ä¿àÅÕé  § à«Íà âÇÁÍàµÍÃ

ÊÇÔµª à» ´» ´ ÊÇÔµª à» ´» ´ ä¿àÅÕé§à«Íà âÇ ÁÍàµÍà ¾Íà µµ Í à«Íà âÇÁÍàµÍà ÊÇÔµª RESET

äÍ«ÕÇÑ´ÍسËÀÙÁÔ DS18B20 ἧµ Íǧ¨Ã (ÍØ»¡Ã³ àÊÃÔÁ µ ͧ¨Ñ´«×Íé á¡)

¨Ø´µ ;Íà µ P0 ¶Ö§ P7 Ẻ㪠¤Í¹à¹ç¡àµÍà JST

ÃÙ»·Õè 2 Åѡɳзҧ¡ÒÂÀÒ¾¢Í§ JX-2P plus ºÍà ´¾Ñ²¹Òâ¤Ã§§Ò¹´ Ç i-Stamp2P ¨Ø´ A0 ¶Ö§ A7 áÅÐ 0 ¶Ö § 15 ¤× Í ¨Ø ´ µ Í ¢Ò¾Íà µ ¢Í§ i-Stamp2P Ê Ç ¹ +5V ¤× Í ¨Ø ´ ¨ Ò Âä¿àÅÕé  § +5V, GND ¤× Í ¨Ø´¡ÃÒÇ´ ¢Í§Ãкº áÅÐ +Vs ¤×ͨش¨ ÒÂä¿àÅÕÂé §ÊíÒËÃѺà«Íà âÇÁÍàµÍà (ËÒ¡ÁÕ¨Ò Âä¿à¢ ÒÁÒÂѧ¨Ø´µ Íä¿ àÅÕÂé §à«Íà âÇÁÍàµÍà ·ÁÕè ÅÕ ¡Ñ ɳÐà» ¹à·Íà Á¹Ô ÍźÅç͡Ẻ¢Ñ¹Ê¡ÃÙ-ÍÂÙ· Ò§¢ÇÒÁ×ͧ͢ºÍà ´)


4 l JX-2P plus : i-Stamp2P Project board

2. ¡ÒÃàµÃÕÂÁâ»Ãá¡ÃÁàºÊÔ¡áʵÁ» àÍ´ÔàµÍà ÊÒí ËÃѺµÔ´µ ͡Ѻ i-Stamp2P (1) ·íÒ¡ÒõԴµÑ§é â»Ãá¡ÃÁ BASIC Stamp Editor (´Òǹ âËÅ´ä´ ¨Ò¡ www.parallax.com) áÅ Ç à» ´â»Ãá¡ÃÁ¢Ö¹é ÁÒ㪠§Ò¹ â´Âä»·Õè Start à Program à Parallax Inc à Stamp editor à BASIC Stamp editor V2.3 ¨Ð»ÃÒ¡¯Ë¹ Òµ Ò§¢Í§â»Ãá¡ÃÁµÒÁÃÙ» àÅ×Í¡àºÊÔ¡áʵÁ» 2P àÅ×Í¡àºÊÔ¡áʵÁ» 2SX

µÃǨÊͺäÇ¡ó

àÅ×Í¡àºÊÔ¡áʵÁ» 2E

´Ù˹ ǤÇÒÁ¨íÒ

àÅ×Í¡àºÊÔ¡áʵÁ» 2

Ãѹâ»Ãá¡ÃÁ

Preference à» ´Ë¹ Òµ Ò§µÑ駤 Ò

Identify

Êà ҧä¿Å ãËÁ à» ´ä¿Å » ´ä¿Å ºÑ¹·Ö¡ä¿Å

à» ´Ë¹ Òµ Ò§ Debug terminal

¾ÔÁ¾ ä¿Å ÍÍ¡à¤Ã×èͧ¾ÔÁ¾

à» ´ä¿Å ª ÇÂàËÅ×Í (Help)

µÑ´¢ ͤÇÒÁ ¤Ñ´ÅÍ¡¢ ͤÇÒÁ ÇÒ§¢ ͤÇÒÁ

¾×¹é ·Õàè ¢Õ¹â»Ãá¡ÃÁ

¤ ¹ËÒ

áÊ´§µíÒá˹ §à¤Íà à«Íà ᶺáÊ´§Ê¶Ò¹Ð

(2) ä»·Õàè Á¹Ù Directive àÅ×Í¡ Stamp à BS2P ´Ñ§ÃÙ»


JX-2P plus : i-Stamp2P Project board l 5

(3) ä»·Õàè Á¹Ù Edit à Preference ¨Ð»ÃÒ¡¯Ë¹ Òµ Ò§ preference ¢Ö¹é áÅ ÇàÅ×Í¡ä»·Õ¡è Ãͺ Stamp mode and ports àÅ×Í¡ Default Com Port ãË áÊ´§ AUTO áÅзաè Ãͺ Stamp mode and ports àÅ×Í¡ Default Project Downlode Mode ãË áÊ´§ Modified

(4) ¤ÅÔ¡·Õ»è ÁØ OK à¾×Íè ¡ÅѺä»Âѧ˹ Òµ Ò§àÍ´ÔàµÍÃ

3. ¡ÒÃ㪠§Ò¹ i-Stamp2P ¡ÑººÍà ´ JX-2P plus (1) µÔ´µÑ§é i-Stamp2P ŧº¹«çÍ¡à¡çµ¢Í§ºÍà ´ JX-2Pplus (2) àª×Íè Áµ ͺÍà ´ JX-2P plus ¡Ñº¾Íà µÍ¹Ø¡ÃÁâ´Â㪠ÊÒ´Òǹ âËÅ´ CX-4 ·Õãè Ë ã¹ªØ´ (3) ¨ ÒÂä¿àÅÕÂé §ãË ºÍà ´ ¨Ò¡¹Ñ¹é à» ´ÊÇÔµª ¨ÐàËç¹ä¿ POWER ·Õè i-Stamp2P µÔ´ÊÇ Ò§ (4) à» ´â»Ãá¡ÃÁàºÊÔ¡áʵÁ» àÍ´ÔàµÍà ·ÕËè ¹ Òµ Ò§àÍ´ÔàµÍà ࢠÒä»ã¹àÁ¹Ù Run àÅ×Í¡ Identified


6 l JX-2P plus : i-Stamp2P Project board

(5) ¶ Ò·Ø¡Í ҧ¶Ù¡µ ͧ ¨Ð»ÃÒ¡¯Ë¹ Òµ Ò§áÊ´§¡ÒõԴµ ʹѧÃÙ»

¨ÐàËç¹Ç Ò㹪 ͧ COM1 ¨Ð»ÃÒ¡¯ª×Íè BASIC Stamp2P40 Vx.x (µÑÇàÅ¢àÇÍà ª¹Ñ ÍÒ¨ à»ÅÕè¹á»Å§ä´ ) Ê Ç¹ã¹ª ͧ Loopback áÅÐ echo »ÃÒ¡¯¢ ͤÇÒÁ Yes à» ¹¡ÒÃᨠ§ãË ·ÃÒºÇ Ò â»Ãá¡ÃÁÊÒÁÒöµÔ´µ ͡ѺàºÊÔ¡áʵÁ» 2P ÍÔ¹àµÍà ¾ÃÕµàµÍÃ ä´ áÅ Ç Ê Ç¹¡ÒÃàª×Íè Áµ ÍÊÒÂáÅСÒà ÃÑºÊ §ÊÑ­­Ò³¶Ù¡µ ͧ¾Ã ÍÁ·íÒ§Ò¹ (6) ¶ Ò»ÃÒ¡¯¢ ͤÇÒÁµÒÁÃÙ»

áÊ´§Ç Ò Ãкº¡ÒÃàª×èÍÁµ ÍÃÐËÇ Ò§¤ÍÁ¾ÔÇàµÍà ¡ÑººÍà ´·´ÅͧŠÁàËÅÇ«Öè§ÍÒ¨à¡Ô´ ¨Ò¡ÊÒÂàª×Íè Áµ ÍÃÐËÇ Ò§¤ÍÁ¾ÔÇàµÍà ¡ºÑ ºÍà ´·´Åͧ¢Ò´ËÃ×͵ ÍäÁ ¶¡Ù µ ͧ ãË ·Òí ¡ÒõÃǨÊͺÊÒ àª×Íè Áµ ÍÇ Òµ Ͷ١µ ͧËÃ×ÍäÁ â´ÂÁÕä´ÍÐá¡ÃÁ¡Òõ ÍÊÒ·Õãè ª 㹡ÒÃàª×Íè Áµ ÍËÃ×Í·Õàè ÃÕÂ¡Ç ÒÊÒ´Òǹ âËÅ´áÊ´§ã¹ÃÙ»·Õè 2-6 ËÃ×ÍÍÒ¨à¡Ô´¨Ò¡äÁ ä´ ¨Ò Âä¿ãË á¡ µÇÑ ºÍà ´ËÃ×͵ԴµÑ§é i-Stamp2P ¼Ô´µíÒá˹ § ËÃ×͵ÑÇÍÔ¹àµÍà ¾ÃÕµàµÍà àÊÕÂËÒ «Ö§è 㹡óÕËÅѧà¡Ô´¢Ö¹é ä´ ÂÒ¡ÁÒ¡ ãË µÃǨÊͺ¡Òè ÒÂä¿á¡ Ç Ò¶Ù¡ ¢ÑÇé ËÃ×ÍäÁ ÊÒÂä¿àÅÕÂé §µ Íá¹ ¹Ë¹ÒÊÁºÙó ´ËÕ Ã×ÍäÁ ÃÇÁ¶Ö§¡ÒõԴµÑ§é i-Stamp2P (7) ·´Åͧà¢Õ¹â»Ãá¡ÃÁ§ ÒÂæ µÒÁ¢Ñ¹é µÍ¹´Ñ§¹Õé (7.1) àÅ×Í¡ä´àÃ硵տËÃ×ͪ¹Ô´¢Í§àºÊÔ¡áʵÁ» ·Õèµ Í§¡ÒÃ㪠§Ò¹ ã¹·Õè¹Õé¤×Í àºÊÔ¡ áʵÁ» 2P ä»·Õàè Á¹Ù Directive àÅ×Í¡ BS2P ¨Ð»ÃÒ¡¯¢ ͤÇÒÁ {$STAMP BS2P} ¢Ö¹é ¡´ Enter (7.2) ¾ÔÁ¾ ¤Òí Êѧè debug welcome à» ¹¡ÒÃÊѧè ãË i-Stamp2P Ê §¢ ͤÇÒÁ welcome ä»áÊ´§Âѧ˹ Òµ Ò§ Debug Terminal ¢Í§â»Ãá¡ÃÁàºÊÔ¡áʵÁ» àÍ´ÔàµÍà áÅ Ç¡´ Enter


JX-2P plus : i-Stamp2P Project board l 7

¤Í¹à¹ç¡àµÍà DB-9 µÑÇàÁÕÂ

»ÅÑ¡ê âÁ´ÙÅÒ Ã RJ11 Ẻ 6P4C

# "

#

!

!

¢Ò RxD

!

¢Ò TxD

"

¢Ò DTR

#

¢Ò GND

"

´ ҹ˹ ÒÊÑÁ¼ÑÊ

ÃÙ»·Õè 3 áÊ´§ÃÒÂÅÐàÍÕ´¡ÒÃàª×Íè Áµ ÍÊÒ´Òǹ âËÅ´·Õãè ª ¡ºÑ ºÍà ´ JX-2P plus (7.3) ¡´»Ø Á Run ¨Ð»ÃÒ¡¯Ë¹ Òµ Ò§µÃǨÊͺ¡ÒÃàª×èÍÁµ ÍàºÊÔ¡áʵÁ» µÒÁ´ Ç ˹ Òµ Ò§´Òǹ âËÅ´â»Ãá¡ÃÁ áÅÐÊØ´· Ò»ÃÒ¡¯Ë¹ Òµ Ò§ Debug Terminal áÊ´§¢ ͤÇÒÁ welcome

(8) ËÒ¡à¢Õ¹â»Ãá¡ÃÁ·´ÅͧàÃÕºà ÍÂáÅ Ç áÅе ͧ¡ÒÃà¡çºã¹ÃٻῠÁ¢ ÍÁÙÅ ãË º¹Ñ ·Ö¡á¿ Á ¢ ÍÁÙÅâ´Â¡íÒ˹´ãË Á¹Õ ÒÁÊ¡ØÅ .BSP àÊÁÍ (9) ¼Ùã ª §Ò¹ÊÒÁÒöµ Íǧ¨ÃµÒÁµ ͧ¡Òà ¨Ò¡¹Ñ¹é à¢Õ¹â»Ãá¡ÃÁ µ ÍÊÒÂࢠҡѺ¤ÍÁ¾ÔÇàµÍà áŠǨ ÒÂä¿ ´Òǹ âËÅ´â»Ãá¡ÃÁ à¾ÕÂ§à· Ò¹Ñ¹é ¡ç¨ÐÊÒÁÒö㪠§Ò¹ i-Stamp2P ä´ Í ҧÊÁºÙó


8 l JX-2P plus : i-Stamp2P Project board

4. µÑÇÍ ҧ·´Êͺ¡ÒÃÍ Ò¹¤ ÒÍسËÀÙÁ¨Ô Ò¡ DS18B20 º¹ºÍà ´ JX-2P plus (1) µÔ´µÑ§é i-Stamp2P ŧº¹«çÍ¡à¡çµ¢Í§ºÍà ´ JX-2Pplus (2) àª×Íè Áµ ͺÍà ´ JX-2P plus ¡Ñº¾Íà µÍ¹Ø¡ÃÁâ´Â㪠ÊÒ´Òǹ âËÅ´ CX-4 ·Õãè Ë ã¹ªØ´ (3) à¢Õ¹â»Ãá¡ÃÁµ Í仹Õé Temp VAR Word 'Holds the temperature value TH VAR Byte TL VAR Byte Config VAR Byte Reserved1 VAR Byte Reserved2 VAR Byte Reserved3 VAR Byte CRC VAR Byte Point VAR Byte x VAR Word Start: AUXIO OWOUT 8, 1, [$CC, $44] 'Send Calculate Temperature command CheckForDone: 'Wait until conversion is done PAUSE 25 OWIN 8, 4, [Temp] 'Here we just keep reading low pulses until IF Temp = 0 THEN CheckForDone 'the DS1820 is done, then it returns high. OWOUT 8, 1, [$CC, $BE] 'Send Read ScratchPad command OWIN 8, 2, [Temp.LOWBYTE,Temp.HIGHBYTE,TH,TL,Config] ' Format Data ' S S S S S B6 B5 B4 : B3 B2 B1 B0 B-1 B-2 B-3 B-4 ' Convert LowByte To Point Temp = Temp & $0FFF DEBUG DEC temp/16,"." x =(Temp << 4) & $00ff x = 10000 */ x DEBUG DEC4 x,CR GOTO start

(4.4) ·íÒ¡ÒôÒǹ âËÅ´ä»Âѧ JX-2P plus ´Ù¼Å¡Ò÷íÒ§Ò¹¼ Ò¹·Ò§Ë¹ Òµ Ò§ Debug Terminal

IN N O V A T IV E E XP E R IM E N T


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.