اطلاعیه

Collapse
No announcement yet.

ورودی icp1 و راه اندازی آن

Collapse
X
 
  • فیلتر
  • زمان
  • Show
Clear All
new posts

    ورودی icp1 و راه اندازی آن

    دوستان توی مداری که میخوام طرحش رو کپی کنم دیتا به پایه 14 مگا 8 اومده
    من با این پایه اصلا کار نکردم کل اطلاعات من در باره این پایه اینه

    مطالبی در مورد مقایسه کننده انالوگ و نحوه راهاندازی ان
    ________________________________________
    راه اندازی این مقایسه کننده با دستور زیر انجام میشود:
    CONFIG ACI =ON/OFF, COMPARE = ON/OFF, TRIGGER=TOGGLE|RISING|FALLING
    CONFIG ACI = ON/OFF : در زمان استفاده از مقایسه کننده باید یک باشد.(در صورت استفاده از صفر مقایسه کننده کار نخواهد کرد).
    COMPARE = ON/OFF: در صورت انتخاب ON ، AC0 مستقیما به ورودی CAPTURE تایمر/کانتر یک وصل می شود.
    TRIGGER=TOGGLE|RISING|FALLING: نحوه روی دادن وقفه مقایسه کننده را نشان می دهد.
    FALLING : یک لبه پایین رونده در خروجی مقایسه کننده باعث یک شدن پرچم وقفه مقایسه کننده و اجرا شدن برنامه وقفه خواهد شد.
    RISING : یک لبه بالا رونده در خروجی مقایسه کننده باعث یک شدن پرچم وقفه مقایسه کننده و اجرا شدن برنامه وقفه خواهد شد.
    TOGGLE : یک به صفر یا یک صفر به یک در خروجی مقایسه کننده باعث یک شدن پرچم وقفه مقایسه کننده و اجرا شدن برنامه وقفه خواهد شد.
    مقایسه کننده آنالوگ مقادیر ولتاژ آنالوگ موجود بر روی دو پایه خود را ( پایه مثبت (AIN0) و پایه منفی (AIN1) ) با هم مقایسه می کند .(مانند op –amp ) .زمانی که ولتاژ موجود در ورودی مثبت بیشتر از ولتاژ موجود در ورودی منفی باشد ، خروجی مقایسه کننده (AC0) یک می شود.مقایسه کننده دارای یک پرچم وقفه مجزا است.خروجی مقایسه کننده می تواند به عنوان تریگر ورودی CAPTURE تایمر/ کانتر یک نیز استفاده شود.
    مثال :
    $regfile = "m8def.dat"
    $crystal = 16000000
    Config Lcd = 16 * 2
    Config Lcdpin = Pin , Db4 = Portb.2 , Db5 = Portb.3 , Db6 = Portb.4 , Db7 = Portb.5 , E = Portb.1 , Rs = Portc.0
    Config Portd = Input
    Config Aci = On , Compare = On , Trigger = Falling
    Config Timer1 = Timer , Capture Edge = Falling , Noise Cancel = 1 , Prescale = 1024
    Enable Interrupts
    Enable Icp1
    Enable Aci
    On Aci Q
    Dim A As Byte
    Do
    Locate 1 , 1
    Lcd Timer1
    Loop
    End
    Q:
    Locate 2 , 1
    Lcd Capture1
    Stop Timer1
    Return
    در مثال بالا تایمر یک در مد Capture راه اندازی شده است ، در این مد در صورتی که یک لبه به پایه ICP (پایه 14 مگا 8 ) اعمال شود ،مقدار شمرده شده توسط تایمر 1 در ریجستر Capture1 ریخته میشود و شما میتوانید از این مقدار استفاده کنید . در مثال به جای لبه بالا رونده از وقفه مقایسه گر استفاده شده است ، هنگامی مقدار ولتاژ پایه مثبت مقایسه گر از ولتاژ پایه منفی بیشتر شود وقفه فعال شده و مقدار شمرده شده توسط تایمر در ریجستر Capture1 ریخته میشود و سپس در موقعیت 2و1 روی LCD به نمایش در میاید ، شما میتوانید در زیر روال وقفه از هر دستور دیگری نیز استفاده کنید ،
    با اسفاده از این روش میتوان زمان تناوب پالس رو اندازه گرفت
    متاسفانه نمیتونم توی شبیه سازی ازش جواب بگیرم کثل مثال عملی داره ؟

    اضافه شده در تاریخ :
    کلا 3 بازدید چقدر زیاده !!!
    [move][img width=133 height=100]http://bargiri.persiangig.com/aks/0.306310001356499787_taknaz_ir.gif[/img][/move]

    #2
    پاسخ : ورودی icp1 و راه اندازی آن

    سلام حامد جان خوبی ؟
    اقا مقایسه کننده انالوگ رو قشنگ راه اندازی کردی ؟
    اگه اون قسمت ok شده تا با هم بریم بخش بعدی.
    چرا ناراحتی پاتریک!
    + امروز ی بچه دیدم سرچهارراه گل میفروخت
    - از دیدنش ناراحت شدی؟
    + نه
    پس چی ناراحتت کرده
    + اینکه دیدن اینجور بچه ها انقدر واسم عادی شده که دیگه ناراحتم نمیکنه
    ------------------------------------------------------------------------------------------------------
    تاحالا فکر کردی بیسواد کیه؟- بی سواد یعنی کسی که نمیتونه ذهنیاتش رو عملی کنه!
    ------------------------------------------------------------------------------------------------------
    محصولات

    دیدگاه


      #3
      پاسخ : ورودی icp1 و راه اندازی آن

      خوب
      سلام داداش سوران گل
      داداش ببین من
      مدار داخلی ماژول rf01d رو دارم کپی میکنم
      کل سخت افزار کپی شده
      مونده میکرو
      با تایمر 2 در حالت فست فرکانس 125 کیلو رو درست کردم (روی پایه 17 مگا 8 )
      حالا توی کل مدار یه پایه خروجی داریم که مستقیم به پایه icp وصل شده واقعیتش من نمیدونم حتی چه اطلاعاتی از کارت در یافت میشه نمیدونم این پایه فقط میتونه اطلاعات دیجیتال در یافت کنه یا نه ؟
      میتونه تو حالت مقایسه ای انالوگ باشه ؟؟؟
      کلا قضیه مهندسی معکوس ه
      اسیلوسکپ حافظه دارم ندارم ببینم قضیه چیه ؟
      خلاصه تو قسمتی که فکر میکردم اسون ترین قسمت کاره گیر کردم

      اضافه شده در تاریخ :
      پروتکل
      Em4100
      پروتکل کارت ماژوله

      EM4100 Protocol description.
      RFID transponders (Tags) are devices carrying digital information that can be read from a distance by a
      RFID transceiver (Reader). In order to be able to read the information stored on the RFID tags the reader
      must know how the information is stored and the protocol for extracting it. One of the more common data
      formats for RFID transponders is the EM4100 protocol, named so because the microchip at the heart of
      the Tag is based on the controller chip made by the company EM Microelectronic.
      Reading an EM4100 RFID Transponder.
      EM4100 compatible RFID transponders carry 64 bits of Read Only memory. This means that information
      can be read from the Tag but no data can be changed, or new data written to the card once the card has
      been programmed with the initial data. The format of the data is as shown here.
      1 1 1 1 1 1 1 1 1 9 bit header bits, all 1's
      8 bit version number D00 D01 D02 D03 P0
      or customer ID. D04 D05 D06 D07 P1
      D08 D09 D10 D11 P2 Each group of 4 bits
      D12 D13 D14 D15 P3 is followed by an Even
      32 Data Bits D16 D17 D18 D19 P4 parity bit
      D20 D21 D22 D23 P5
      D24 D25 D26 D27 P6
      D28 D29 D30 D31 P7
      D32 D33 D34 D35 P8
      D36 D37 D38 D39 P9
      4 column Parity bits PC0 PC1 PC2 PC3 S0 1 stop bit (0)

      When the Tag enters the electromagnetic field transmitted by the RFID reader it draws power from the field
      and will commence transmitting its data as shown above. The first 9 bits are a logic 1. These bits are used as
      a marker sequence to indicate the beginning of the string. As Even parity is used throughout the data this 9 bit
      sequence of 1's will not occur at any other location in the string. This is followed by 10 groups of 4 data and 1
      even parity bits. Finally there are 4 bits of column parity (Even) and a stop bit (0). The Tag then continues to
      repeat this string as long as it has power.

      Shown here is an example string for a proximity card that has the data $06 (version number), and $001259E3
      as a data string.
      1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 1 0 1 0 1 0 1 0 1 0 0 1 0 1 1 1 0 1 0 0 1 1 0 0 1 0 00
      0 6 0 0 1 2 5 9 E 3
      Data modulation.
      As discussed in RFID basics the RFID transponder is able to transmit its data by modulating the RF field of
      the Reader. Here we discuss 3 popular modulation schemes.
      Manchester Encoding.
      BiPhase Encoding.
      PSK Encoding.

      The Transponder and Reader use the individual cycles of the RF field to syncronize the data transmission
      between the two. The frequency of the synchronizing clock then simply becomes the frequency of the RF field
      used.
      RFID system clock frequencies vary according to the application required. In low frequency, short distance
      sensing of Tags the typical band used is between 100-150Khz. For longer range sensing a system frequency
      of 13.56Mhz might be used, or other frequency as the application requires.
      Of course the designer of an RFID system is restricted to using particular frequency bands as RFID systems
      are radio emitting devices and therefore under the control of the local radio frequency regulator bodies.

      The length of each bit is specified in terms of clock cycles. For the EM4100 protocol bit lengths can be either
      64, 32, or 16 Clock cycles.
      Manchester Encoding Scheme.
      With Manchester Encoding a Tag will produce a level transition in the middle of the bit period. A low to high
      transition represents a logic 1 state, while a high to low transition represents a logic 0 state.


      BiPhase Encoding Scheme.
      Biphase Encoding schemes modulate the RF field so that there is a transition at the beginning of each bit
      boundary. A logic 0 state has a transition in the middle of the bit period, while a logic 1 state has no transition
      during the entire bit period.

      PSK Encoding.
      With PSK (Phase Shift Keying) encoding the RF field is modulated so that there is a transition with each clock
      period. This means there can be up to 64, 32, or 16 transitions per bit depending on what bit length the Tag is
      using. When a phase shift occurs it represents a logic 0 state, while a logic 1 state is interpreted when there is
      no phase change at the bit boundary.

      Priority 1 Design carries a stock of low cost EM4100 compatible Transponders. We also carry a stock of
      low cost T5557 RFID Read Write transponders, You can buy EM4100 and T5557 transponders direct from
      our online shopfront. See T5557 RFID transponder to learn about reading and writing RFID tags.

      See Specifications.

      [move][img width=133 height=100]http://bargiri.persiangig.com/aks/0.306310001356499787_taknaz_ir.gif[/img][/move]

      دیدگاه


        #4
        پاسخ : ورودی icp1 و راه اندازی آن

        برادر حامد پایه 14 مخصوص مد capture تایمر 1 هست و مقایسه کننده آنالوگ در پایه های 12 و 13 قرار دارن!
        واقعا اگه می دونستیم دیتا چیه و قراره چه اتفاقی بیوفته یه نمونه کد با هم را می نداختیم ولی :cry2:
        خب این دیتاها چه شکلی از کارت به میکرو میرن آخه :angry: :angry: :sad:
        چرا ناراحتی پاتریک!
        + امروز ی بچه دیدم سرچهارراه گل میفروخت
        - از دیدنش ناراحت شدی؟
        + نه
        پس چی ناراحتت کرده
        + اینکه دیدن اینجور بچه ها انقدر واسم عادی شده که دیگه ناراحتم نمیکنه
        ------------------------------------------------------------------------------------------------------
        تاحالا فکر کردی بیسواد کیه؟- بی سواد یعنی کسی که نمیتونه ذهنیاتش رو عملی کنه!
        ------------------------------------------------------------------------------------------------------
        محصولات

        دیدگاه


          #5
          پاسخ : ورودی icp1 و راه اندازی آن

          خوب بحث اینجاست !!
          دو تا اپ امپ هست که این کار رو میکنه
          الان تنها مشکلم اینه که نه میدونم چه دیتایی به میکرو میاد نه میدونم چی میخوایم بنویسیم
          پس طبق گفته شما فقط مقادیر 0و1 منتقی روی این پایه جا دارن
          حالا گذشته از این
          این پایه به چه دردی میخوره و چه کار برد هایی داره من وقفه رو این پایه رو استفاده کردم
          و یه برنامه دیگه هم شبیه سازی کردم که مقدار تایمر رو در یه ریجیستر میریخت
          [move][img width=133 height=100]http://bargiri.persiangig.com/aks/0.306310001356499787_taknaz_ir.gif[/img][/move]

          دیدگاه

          لطفا صبر کنید...
          X