-
Notifications
You must be signed in to change notification settings - Fork 102
Sleep and when detect card wake up #21
Comments
I have not tried but the low power card detection (LPCD) mode but this feature is very interesting! |
.I want to wake up it by using a mifare simple tag. as i understand i need to 4 parameters SWITCH_MODE, SWITCH_MODE(Mode as lpcd),time min val , time up value. |
PN5180_SWITCH_MODE command is defined in PN5180.cpp line 34, the command should be easy to implement, see command loadRFConfig() how it works in this library. |
normally i dont use nxp library , check it for just to see the uses. That's exactly what I want to do. Sleeping Ardunio and PN5180 card. When the Pn5180 detects a card, wake ardunio and read the card. I will use card as ISO 14443 Type A Mifare 1K 13.56. |
Same as i want to do. See my fork/branch for ISO-14443 / Mifaire support. Current loop for card detection consumes 50-70 mA.. |
thank you for help @tueddy , if i success i will send pull reques to your branch. |
Hi Mert,
one small thing I saw after comparing your code snippet to the PN5180
specification:
Field ‘Wake-up Counter Value’ () defines the period between two LPCD
attempts (=time
PN5180 remains in standby) as has to be in the range from 1 to 2690,
inclusive. No
instructions must be sent while being in this mode. Termination is
indicated using an
interrupt.
That in mind, your counter is out of range:
uint16_t wWakeupCounterInMs=0U;
Maybe that will change something.
Cheers
--Andreas.
|
Hi, i've implemented the function in my branch like this:
But i'm unable to make a working demo. The only thing i can see is power consumption is dropped to 5-7mA, but no LPCD IRQ is being raised. Any idea? Switch RF on before switchToLPCD? |
Hi, Best regards |
i get such error while uploading. Have you ever had a error like this? What's your SPI version? @tueddy C:\Users\velia\Documents\Arduino\libraries\PN5180_Updater-master\src\PN5180_Firmware.cpp: In member function 'bool PN5180_Firmware::RawTransceive(const uint8_t*, size_t, uint8_t*, size_t)': C:\Users\velia\Documents\Arduino\libraries\PN5180_Updater-master\src\PN5180_Firmware.cpp:105:42: error: no matching function for call to 'SPIClass::transfer(uint8_t*, const size_t&)' SPI.transfer((uint8_t*)TxBuffer, TxSize);
C:\Users\velia\Documents\Arduino\libraries\PN5180_Updater-master\src\PN5180_Firmware.cpp:105:42: note: candidate is: In file included from C:\Users\velia\Documents\Arduino\libraries\PN5180_Updater-master\src\PN5180_Firmware.h:13:0,
C:\Users\velia\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2019.12.31\libraries\SPI\src/SPI.h:286:11: note: uint8 SPIClass::transfer(uint8) const
C:\Users\velia\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2019.12.31\libraries\SPI\src/SPI.h:286:11: note: candidate expects 1 argument, 2 provided C:\Users\velia\Documents\Arduino\libraries\PN5180_Updater-master\src\PN5180_Firmware.cpp:119:32: error: no matching function for call to 'SPIClass::transfer(uint8_t*&, size_t&)' SPI.transfer(RxBuffer, RxSize);
C:\Users\velia\Documents\Arduino\libraries\PN5180_Updater-master\src\PN5180_Firmware.cpp:119:32: note: candidate is: In file included from C:\Users\velia\Documents\Arduino\libraries\PN5180_Updater-master\src\PN5180_Firmware.h:13:0,
C:\Users\velia\AppData\Local\Arduino15\packages\stm32duino\hardware\STM32F1\2019.12.31\libraries\SPI\src/SPI.h:286:11: note: uint8 SPIClass::transfer(uint8) const
|
Hi velinazim, My LPCD demo is here: https://github.com/tueddy/PN5180-Library/tree/ISO14443/examples/PN5180-LowPowerCardDetection |
Hi, |
@abidxraihan can you share your lpcd works code ? |
Sure, here is the code PN5180-LowPowerCardDetection_Firmware 4.1.zip. The library that was used was Tueddy's https://github.com/tueddy/PN5180-Library. |
@abidxraihan Thanks for sharing! Your ESP-32 updater should make live easier! Can you tell what is different in your demo to mine? I see another treshold but no other important diffs. Can you share some experience using LPCD? Thanks & best regards |
@abidxraihan : Your LPCD demo runs fine, thanks! |
I have added a simple demo showing wake-up an ESP-32 from deep-sleep using LPCD. The trick is to freeze the pin states before going to deep sleep:
Power consumption is ~300uA in deep-sleep mode. This video shows usage in a kids audio player. if metal is on reader, the ESP-32 also wakes up but player software decides to goe to sleep again (false alarm): LPCD.mov |
Hi, I am designing a low power device that uses PN5180. And can not reach less than 200uA on LPCD with 500ms RF on. Anyone have idea how to have less consumption? The amount of 200uA are from VBAT pins. Thanks |
I am trying to run this sensor on sleep mode but I could not Pn5180 will sleep and when detect card wake up ? Did any one try this ?
bool PN5180::switchModeNormal() {
The text was updated successfully, but these errors were encountered: