#DCF77 TX emulator

117 messages · Page 1 of 1 (latest)

sacred lodge
#

*WIP* needs cleanup

Signal on lfrfid antenna at 77.5kHz is barely there, but significantly stronger (and picked up by my watch from more than a few mms away) on second harmonic.

Clock signal is generated from FZ internal clock.

Baseband signal also comes out through GPIO for those special times you need a portable DCF77 TXer and have a portable LF antenna array in your pocket. Building said TXer is left as an exercise for the reader.

topaz bronze
#

Is this for setting those watches and clocks through rf? Great work!

sacred lodge
#

yep and yep, that's the one, there are many more than DCF though

lime schooner
#

Too bad I don't still own a US radio clock, I wonder if 60khz for the USA WWVB station signal would be too low to get any kind reasonable output.

loud flare
#

where is the source?

umbral delta
#

Would love to see the source + get any pointers you have or references you used for the RFID HAL API! I’ve been trying to write my own app that uses the LF coil (similar to this) but have been struggling

loud flare
#

@sacred lodge ping

sacred lodge
#

bong

#

no source yet cause it s a mess

#

rfid hal api is no api for what i did, you simply set a timer and bitbang a pin. you can find more in the rfid reader app

#

lfrfid works entirely bitbanged in software, with the hardware simply being a gain stage for output, and a bunch of filters on the input

umbral delta
#

@sacred lodge how does the timer system work? I was looking at doing it naively with furi_delay_us() and loops, but skotopes#4130 mentioned I’d run into issues without disabling interrupts &c.

#

Also, when you say bitbanging, you mean just furi_hal_gpio_write()-ing to RFID_OUT? Anything else you had to do to get it to work beyond init-ing that pin?

glacial vale
#

@sacred lodge tried it with my DCF77 clock; no luck (yet) on what GPIO pin is the signal also available? will try again with a wire loop

#

used it with FW 0.71.2 , is that the correct API ?

sacred lodge
#

bare metal, a timer simply stops execution and jumps to a specific piece of code (interrupt vector). in freertos and flipper, timers are a bit more involved, you schedule stuff to happen at specific intervalz

sacred lodge
sacred lodge
umbral delta
sacred lodge
#

iirc it was the leftmost pin, it should blink in sync with the FZ led. but it's only the baseband signal (1Hz and 80%/90% duty cycle for 0/1)

#

uh

sacred lodge
#

try to go bare metal and see what registers do and what happens

#

stm32 is quite a lot to take in as a first dive into embedded but... if you'd rather not do that

#

probably reading on freertos timers and threds and checking how flipper implements them will suffice for your application

#

the thing is, you really need to go deeper and understand the hardware

#

for example in my case (77.5khz rf signal, 1Hz baseband signal) you can bitbang and run a timer at 155 khz... or you can simply figure out how to tell the hardware to generate a 155khz signal for you, which you can enable or disable

umbral delta
umbral delta
sacred lodge
#

no, i did the latter

#

set timer registers to generate a 155khz signal, which i conveniently disable/enable to match dcf77 specs

#

you can check hardware "code" in the furi_hal_* files and check how those functions are used in stock applications

#

you can literally do it all on github too, it's got great search and crossreferencing, unlike some "modern" electronjs IDEs

#

guess bitbangijg it was a misnomer on my side

#

it was meant like "flipper does lfrfid with its gpio, no extra ICs"

glacial vale
sacred lodge
#

i don't understand what that means

#

the 59th second is marked different than 0 or 1 bits, otherwise, you wouldn't know when is the :00 second

glacial vale
#

this is the signal from FZ pinA7

sacred lodge
#

oh that seems like a bug

#

did you pick it up rx side?

glacial vale
#

on the GPIO side A7

#

all bits are banged clean

#

only the last sequence is disturbed

sacred lodge
#

yeah that shouldn't happen byt i never tested with a TXer from gpio, only with the rfid antenna

glacial vale
#

(stupid) idea to inject a time out at start/end to avoid /idenfy the cause?

sacred lodge
#

it probably filtered it out

#

will check

#

nah i know 100% what it is, it's what generates the special 59 seconds bit

glacial vale
#

what should be the freq? That I can verify

sacred lodge
#

none, that's the thing

#

0 bits are 800ms, 1 bits are 900ms off the top of my head

glacial vale
#

happens after -end bit-

sacred lodge
#

however, the 59th bit is a full 1000ms carrier on/0ms off

#

59th bit + 0th bit are usually a long, almost 2 sec mark

glacial vale
#

Ok will focus on that and report back

sacred lodge
#

highly appreciated but don't worry too much

#

you planning to build a TXer too?

glacial vale
#

Build? nearby wire loop not enough?

sacred lodge
#

oh i don't mean anything on the scale of the Mainhausen installation 🙃

glacial vale
#

going for the easy/lazy way

#

what I can see = last bit is not cleared and first bit is mashed up , a small delay might solve it

glacial vale
glacial vale
sacred lodge
#

i'm not using a delay, i'm syncing to FZ's clock and enabling the 77.5 carrier on, iirc, a 10 Hz timer (so i can create duty cycles in 10% steps)

#

pfobably just some logic messed up on the end condition

#

will check when i get home

glacial vale
#

Thanks!

sacred lodge
#

yeah, using the internal antenna is definitely the appeal here i agree

#

otherwise it would just be yet another arduino-clone-board project

glacial vale
#

use the onboard antenna (stealth mode) out of the box (thinking)

#

on the other hand: GPIO output gave a insight on the generated signal (debug)

glacial vale
#

@sacred lodge found some solution/strange code?

sacred lodge
#

sorry, didn't follow through

#

new kernel brought a lot of changes since 0.68 and even after compiling making the old app compile, it still randomly crashes on the new kernel

#

going back to 0.68, same code works fine, so I'm not sure what I'm doing wrong

#

will check

glacial vale
#

Thank you!

sacred lodge
#

gpio out is C3 now near gnd, A7 was the comparator output

#

it's... sketchier though. i'm not sure what changed over in three releases, but the timer which generates the baseband signal is somehow even less stable now

#

(was 30 Hz, with 24/30 or 27/30 full carrier on - to generate 800, respectively 900 ms pulses)

#

gonna try with 10Hz lol, i should probably move away from a furi timer and use a rtos native one

#

it seems to stabilize after one cycle though

#

it seems to happen on a very dumb program too (interrupt at 30 hz, pin on for 15 cycles, off for 15 cycles) with jitter actually visible on a scope

#

it does not seem to happe non 0.69 so... idk

#

technically it works - just not the first try. it even set a watch that the previous ver didnt'

glacial vale
#

@sacred lodge downloaded and tested: not a (big) success = 1 clock only did catch-up with the minutes and seconds (not hour)

sacred lodge
#

sadly i doubt you'll get more range out of it, the antenna is really mistuned

#

even with a real DCF77 signal, it still takes a few minutes for everything to sync up, some smart devices will hold on to values they know they are correct, and compare them with the next values - untill every value is RXed and correctly predicted - some will simply overwrite them and display them. you can even have cheap clocks show 24:69

#

basically: one timestamp is sent per minute (end of minute = syncs to seconds 00)

#

if something is missing, you need to wait another minute

#

I needed about 5 minutes at least for a full sync (even with test dates, not real dates)

#

there's probably yet another version to abuse the hardware

#

using the piezo buzzer at 15.5khz

#

I think it was done like that over headphones

#

or maybe 7.75 khz, but that's audio range and annoying as hell

#

oh yeah baby, 7750 hz in audio range, buzzing every second, for a few minutes is going to be ear candy

#

the dates will probably fail much more often, because the parity is counted over 3 bytes, so if a single bit flips, the whole date fails

#

I need to learn how to do flipper-style menus and scenes, so I can implement some more tools and settings into this app

umbral delta
#

Can confirm it works on the flipper as well, you just have to hold it extremely close

sacred lodge
#

i mean

#

does the EMF from a voicecoil bouncing against a magnet really count as parasitic? troll

#

the cool thing with audiofreq signals (and harmonics) is that you can do them with anything, phone, smart fridge, old timey mp3 player, reel tape player

#

so if dcf77 clocks really pick up on 7750hz voicecoil emf when they're tuned to 77500hz, that's cool

#

i've seen it working with 15500 hz and headphones, but it's so annoying

oblique seal
#

this is incredible!
thought about it, but dismissed it because i thought the rfid hardware couldnt be "misused" in this way.

sacred lodge
#

less of a mess 🤷 don't bypass locks and do stuff inside timers like I do; tl:dr don't use my code as reference

half jay
#

Good morning. For several weeks, it is no longer possible for me to read any RFID badge (although this worked before with these same badges). The emulator works. Any ideas? I have already formatted.