View previous topic :: View next topic |
Author |
Message |
unisaco
Joined: 03 Dec 2012 Posts: 6
|
How can I modify em4015 driver to code RFID without CCP2 |
Posted: Mon Dec 03, 2012 11:37 am |
|
|
Hi everybody,
So far, I succeeded when made a RFID 125 khz project with em4095 driver (hardware made by me).
My project: use RFID to open the door. The ID number of tag will be stored on EEPROM of PIC. When somebody scan their tag, this tag value will be compared with EEPROM value => open door or not
For my project, I just only use 6 PIN: 4 for EM4095, 1 for speaker and the last one for control Relay.
First one, I bought PIC 16F628 to communicate with EM4095 IC, but when Compiled, I got many error message such as:
Undefined indetifier CCP_2
It mean PIC 16F628 is only has 1 CCP. So I replaced this PIC by 16F877A and my Project worked perfectly.
But the cost for 16F877 in my country is so higher than 16F628 (maybe higher a half of cost). Beside, with 16F877A, there is so many pin I/O not yet be used => waste and can make noise to MCU
----------------
So, anybody who already modified em4095 driver, to use for PIC with just only one CCP, can you show me this code ? or can you teach me how to do that ? So many thanks if you can provide code sample for me. I think it also helpful for everyone.
---------------
Thank you for reading, hope someone reply soon ^^ |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
|
unisaco
Joined: 03 Dec 2012 Posts: 6
|
|
Posted: Mon Dec 03, 2012 7:28 pm |
|
|
Thanks Humberto ^^
I have another question. Although I don't have any PIC 16F88x (16F882 / 16F883 / 16F887 ...) But when I try using those PIC with em4095 driver => compile hex file OK
Base on Microchip Website, 16F883 has:
1 -CCP 1 -ECCP 10-bit PWM resolutions
It mean this PIC just only one CCP. So why I don't meet any error message like: Undefined indetifier CCP_2 when I compile RFID project.
Anybody who already tested em4095 driver with PIC 16f88x ? Is it ok right ? |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Dec 03, 2012 7:56 pm |
|
|
Quote: | It mean this PIC just has only one CCP.
|
Not true.
Read the 16F883 data sheet. Both CCP1 and CCP2 can do the ordinary
CCP function. That's all you need for em4095.c, so it will work OK:
Quote: |
11.0 CAPTURE/COMPARE/PWM MODULES (CCP1 AND CCP2)
This device contains one Enhanced Capture/Compare/
PWM (CCP1) and Capture/Compare/PWM module
(CCP2). The CCP1 and CCP2 modules are identical in
operation, with the exception of the Enhanced PWM
features available on CCP1 only.
|
CCP1 has additional optional features available, but they are not
needed for em4095.c. |
|
|
|