From: realraum Date: Mon, 12 Dec 2011 21:46:20 +0000 (+0000) Subject: added non working rf433rcv X-Git-Url: https://git.realraum.at/?a=commitdiff_plain;ds=sidebyside;h=3dd363874cc677b1403c7c86bb582707821b61cc;p=svn42.git added non working rf433rcv --- diff --git a/rf433rcv/Makefile b/rf433rcv/Makefile index 49bf913..0f51cc6 100755 --- a/rf433rcv/Makefile +++ b/rf433rcv/Makefile @@ -14,7 +14,7 @@ F_CPU = 16000000 RESET_TTY_DIR=../reset_tty/ RESET_TTY=$(RESET_TTY_DIR)reset_tty -ARDUINO = $(INSTALL_DIR)/hardware/cores/arduino +ARDUINO = $(INSTALL_DIR)/hardware/teensy/cores/teensy AVR_TOOLS_PATH = /usr/bin SRC = $(ARDUINO)/pins_arduino.c $(ARDUINO)/wiring.c \ $(ARDUINO)/wiring_analog.c $(ARDUINO)/wiring_digital.c \ @@ -94,7 +94,7 @@ all: applet_files build sizeafter build: elf hex -applet_files: $(TARGET).pde +applet_files: $(TARGET).cpp # Here is the "preprocessing". # It creates a .cpp file based with the same name as the .pde file. # On top of the new .cpp file comes the WProgram.h header. @@ -103,9 +103,7 @@ applet_files: $(TARGET).pde # refer to this new, automatically generated, file. # Not the original .pde file you actually edit... test -d applet || mkdir applet - echo '#include "WProgram.h"' > applet/$(TARGET).cpp - cat $(TARGET).pde >> applet/$(TARGET).cpp - cat $(ARDUINO)/main.cxx >> applet/$(TARGET).cpp + cp arduino/hardware/teensy/cores/teensy/WProgram.h . elf: applet/$(TARGET).elf hex: applet/$(TARGET).hex @@ -163,7 +161,7 @@ extcoff: $(TARGET).elf $(NM) -n $< > $@ # Link: create ELF output file from library. -applet/$(TARGET).elf: $(TARGET).pde applet/core.a +applet/$(TARGET).elf: $(TARGET).cpp applet/core.a $(CC) $(ALL_CFLAGS) -o $@ applet/$(TARGET).cpp -L. applet/core.a $(LDFLAGS) applet/core.a: $(OBJ) diff --git a/rf433rcv/WProgram.h b/rf433rcv/WProgram.h new file mode 100644 index 0000000..13e473d --- /dev/null +++ b/rf433rcv/WProgram.h @@ -0,0 +1,62 @@ +#ifndef WProgram_h +#define WProgram_h + +#include +#include +#include + +#ifdef GCC_VERSION +#if (GCC_VERSION < 40300) +#warning "Your avr-gcc and avr-libc are too old, please upgrade" +#endif +#if (GCC_VERSION >= 40300) && (GCC_VERSION < 40302) +// gcc 4.3.0 fails to save context for some interrupt routines - very ugly +#warning "Buggy GCC 4.3.0 compiler, please upgrade!" +#endif +#endif + +#include +#include "wiring.h" + +#ifdef __cplusplus +#include "usb_api.h" +#include "WCharacter.h" +#include "WString.h" +#include "HardwareSerial.h" + +uint16_t makeWord(uint16_t w); +uint16_t makeWord(byte h, byte l); + +#define word(...) makeWord(__VA_ARGS__) + +unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L); + +void tone(uint8_t pin, uint16_t frequency, uint32_t duration = 0); +void noTone(uint8_t pin); + +// WMath prototypes +long random(long); +long random(long, long); +void randomSeed(unsigned int); +long map(long, long, long, long, long); + +#if defined(__AVR_ATmega32U4__) || defined(__AVR_AT90USB646__) || defined(__AVR_AT90USB1286__) +const static uint8_t A0 = CORE_ANALOG0_PIN; +const static uint8_t A1 = CORE_ANALOG1_PIN; +const static uint8_t A2 = CORE_ANALOG2_PIN; +const static uint8_t A3 = CORE_ANALOG3_PIN; +const static uint8_t A4 = CORE_ANALOG4_PIN; +const static uint8_t A5 = CORE_ANALOG5_PIN; +const static uint8_t A6 = CORE_ANALOG6_PIN; +const static uint8_t A7 = CORE_ANALOG7_PIN; +#if defined(__AVR_ATmega32U4__) +const static uint8_t A8 = CORE_ANALOG8_PIN; +const static uint8_t A9 = CORE_ANALOG9_PIN; +const static uint8_t A10 = 10; +const static uint8_t A11 = CORE_ANALOG11_PIN; +#endif +#endif + +#endif // __cplusplus + +#endif // WProgram_h diff --git a/rf433rcv/a.out b/rf433rcv/a.out new file mode 100755 index 0000000..eea06b0 Binary files /dev/null and b/rf433rcv/a.out differ diff --git a/rf433rcv/applet/rf433rcv.cpp b/rf433rcv/applet/rf433rcv.cpp new file mode 100644 index 0000000..e2f7397 --- /dev/null +++ b/rf433rcv/applet/rf433rcv.cpp @@ -0,0 +1,198 @@ +#include "WProgram.h" +#include +#include +#include + +#define RF433_PIN 0 +//********************************************************************// + +typedef unsigned char byte; + +typedef struct { + byte offset; + byte state; +} rf_bit_t; + +// offset is number of alphas (0.08ms) + +const rf_bit_t zero_bit[] = { { 4, 1 }, + { 16, 0 }, + { 20, 1 }, + { 32, 0 }, + { 0, 0 } }; + +const rf_bit_t one_bit[] = { { 12, 1 }, + { 16, 0 }, + { 28, 1 }, + { 32, 0 }, + { 0, 0 } }; + +const rf_bit_t float_bit[] = { { 4, 1 }, + { 16, 0 }, + { 28, 1 }, + { 32, 0 }, + { 0, 0 } }; + +const rf_bit_t sync_bit[] = { { 4, 1 }, + { 128, 0 }, + { 0, 0 } }; + +typedef enum { ZERO = 0, ONE , FLOAT , SYNC } adbit_t; +typedef byte ad_bit_t; +#define WORD_LEN 13 +typedef ad_bit_t word_t[WORD_LEN]; + +const rf_bit_t* bit_defs[] = { zero_bit, one_bit, float_bit, sync_bit }; + +byte alpha_cnt = 0; +byte bit_cnt = 0; +byte chunk_cnt = 0; +byte word_cnt = 0; +const ad_bit_t* current_word; +byte volatile frame_finished = 1; + +#define FRAME_LEN 8 + +#define A1_ON 0 +#define A1_OFF 1 +#define A2_ON 2 +#define A2_OFF 3 + +#define B1_ON 4 +#define B1_OFF 5 +#define B2_ON 6 +#define B2_OFF 7 + +#define C1_ON 8 +#define C1_OFF 9 +#define C2_ON 10 +#define C2_OFF 11 + +#define D1_ON 12 +#define D1_OFF 13 +#define D2_ON 14 +#define D2_OFF 15 + +const word_t words[] = { +{ ZERO, ZERO, FLOAT, FLOAT, ZERO, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, FLOAT, SYNC }, // A1_ON +{ ZERO, ZERO, FLOAT, FLOAT, ZERO, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, SYNC }, // A1_OFF +{ ZERO, ZERO, FLOAT, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, FLOAT, SYNC }, // A2_ON +{ ZERO, ZERO, FLOAT, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, SYNC }, // A2_OFF + +{ FLOAT, ZERO, FLOAT, FLOAT, ZERO, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, FLOAT, SYNC }, // B1_ON +{ FLOAT, ZERO, FLOAT, FLOAT, ZERO, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, SYNC }, // B1_OFF +{ FLOAT, ZERO, FLOAT, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, FLOAT, SYNC }, // B2_ON +{ FLOAT, ZERO, FLOAT, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, SYNC }, // B2_OFF + +{ ZERO, FLOAT, FLOAT, FLOAT, ZERO, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, FLOAT, SYNC }, // C1_ON +{ ZERO, FLOAT, FLOAT, FLOAT, ZERO, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, SYNC }, // C1_OFF +{ ZERO, FLOAT, FLOAT, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, FLOAT, SYNC }, // C2_ON +{ ZERO, FLOAT, FLOAT, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, SYNC }, // C2_OFF + +{ FLOAT, FLOAT, FLOAT, FLOAT, ZERO, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, FLOAT, SYNC }, // D1_ON +{ FLOAT, FLOAT, FLOAT, FLOAT, ZERO, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, SYNC }, // D1_OFF +{ FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, FLOAT, SYNC }, // D2_ON +{ FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, SYNC } // D2_OFF +}; + + +//********************************************************************// + +void start_timer() +{ + // timer 1: 2 ms + TCCR1A = 0; // prescaler 1:8, WGM = 4 (CTC) + TCCR1B = 1< 0.08ms @ 16 MHz -> 1*alpha +// OCR1A = 207; // (1+207)*8 = 1664 -> 0.104ms @ 16 MHz -> 1*alpha + TCNT1 = 0; // reseting timer + TIMSK1 = 1< 2 && rf433_lo_cnt<6 && rf433_hi_cnt>10 && rf433_hi_cnt < 14) + { + rf433_data.uint32<<=1; + rf433_data.uint32|=1; + valid++; + } else if (rf433_hi_cnt > 2 && rf433_hi_cnt<6 && rf433_lo_cnt>10 && rf433_lo_cnt < 14) { + rf433_data.uint32<<=1; + valid++; + } else if (rf433_hi_cnt > 2 && rf433_hi_cnt<6 && rf433_lo_cnt>120 && rf433_lo_cnt < 128 && valid >=24) { + //rf433_data.uint8[3]=0; + //Serial.print(rf433_data.uint32); + Serial.print(rf433_data.uint8[0],BYTE); + Serial.print(rf433_data.uint8[1],BYTE); + Serial.print(rf433_data.uint8[2],BYTE); + //Serial.print(rf433_data.uint8[3],BYTE); + } else { + valid=0; + rf433_data.uint32=0; + } + rf433_hi_cnt=0; + rf433_lo_cnt=0; + } + if (sample == HIGH) + rf433_hi_cnt++; + else + rf433_lo_cnt++; + last_sample=sample; +} + +//unsigned long wm_start_[3]={0,0,0}; +//bool wait_millis(unsigned long *start_time, unsigned long ms) +//{ +// if (ms == 0) +// return false; +// else if (*start_time > 0) +// { +// if (millis() < *start_time || millis() > (*start_time) + ms) +// { +// *start_time = 0; +// return false; +// } +// else +// return true; +// } +// else +// { +// *start_time=millis(); +// return true; +// } +//} + +//********************************************************************// + +void setup() +{ + pinMode(RF433_PIN, INPUT); // set pin to input + digitalWrite(RF433_PIN, LOW); // turn of pullup resistors + + Serial.begin(57600); +// Serial.println("starting timer"); + start_timer(); +} + + +void loop() +{ +} diff --git a/rf433rcv/applet/rf433rcv.elf b/rf433rcv/applet/rf433rcv.elf new file mode 100755 index 0000000..63d5533 Binary files /dev/null and b/rf433rcv/applet/rf433rcv.elf differ diff --git a/rf433rcv/applet/rf433rcv.hex b/rf433rcv/applet/rf433rcv.hex new file mode 100644 index 0000000..197d61f --- /dev/null +++ b/rf433rcv/applet/rf433rcv.hex @@ -0,0 +1,313 @@ +:100000000C9462000C948A000C948A000C948A0070 +:100010000C948A000C948A000C948A000C948A0038 +:100020000C948A000C948A000C948A000C94CD00E5 +:100030000C948A000C948A000C948A000C948A0018 +:100040000C948C010C948A000C9463030C948A0029 +:100050000C948A000C948A000C948A000C948A00F8 +:100060000C948A000C948A000000000024002700F1 +:100070002A0000000000250028002B0000000000DE +:1000800023002600290004040404040404040202DA +:100090000202020203030303030301020408102007 +:1000A0004080010204081020010204081020000012 +:1000B0000007000201000003040600000000000029 +:1000C0000000C00411241FBECFEFD8E0DEBFCDBFBB +:1000D00011E0A0E0B1E0EEE3F3E102C005900D9283 +:1000E000A633B107D9F711E0A6E3B1E001C01D9234 +:1000F000A73EB107E1F710E0C4ECD0E004C02297BE +:10010000FE010E949909C23CD107C9F70E94C800AC +:100110000C949D090C940000109280008AE080935A +:1001200081008FE990E0909389008093880010927D +:1001300085001092840082E080936F0008951092F1 +:10014000810010926F000895089580E060E00E94A1 +:10015000A70280E060E00E94C70285ED91E040E0E8 +:1001600051EE60E070E00E94FC03109280008AE093 +:10017000809381008FE990E09093890080938800BC +:10018000109285001092840082E080936F000895A1 +:100190000E946D020E94A500FFCF1F920F920FB622 +:1001A0000F9211241F932F933F934F935F936F935D +:1001B0007F938F939F93AF93BF93EF93FF9380E0D1 +:1001C0000E941403182F80914201811709F483C003 +:1001D000113009F088C090914101892F83508330FC +:1001E000A0F4809140018B3080F08E3070F48091CB +:1001F0003C0190913D01A0913E01B0913F01880FDB +:10020000991FAA1FBB1F816017C0809140018350B6 +:10021000833008F04FC09B3008F44CC09E30F0F49F +:1002200080913C0190913D01A0913E01B0913F0130 +:10023000880F991FAA1FBB1F80933C0190933D011B +:10024000A0933E01B0933F018091430190914401FE +:100250000196909344018093430138C0993750F13F +:1002600097FD28C08091430190914401489714F173 +:1002700040913C0150E060E070E085ED91E020E0CD +:1002800030E00E94660640913D0150E060E070E081 +:1002900085ED91E020E030E00E94660640913E014D +:1002A00050E060E070E085ED91E020E030E00E94F9 +:1002B00066060CC0109244011092430110923C015A +:1002C00010923D0110923E0110923F0110924001A8 +:1002D0001092410102C0113031F4809140018F5FD2 +:1002E0008093400105C0809141018F5F809341015F +:1002F00010934201FF91EF91BF91AF919F918F9128 +:100300007F916F915F914F913F912F911F910F902E +:100310000FBE0F901F9018951F920F920FB60F925D +:1003200011242F938F939F93AF93BF938091450197 +:1003300090914601A0914701B09148010196A11DFD +:10034000B11D8093450190934601A0934701B0935E +:1003500048018091490190914A01A0914B01B091CF +:100360004C018050904CAF4FBF4F80934901909308 +:100370004A01A0934B01B0934C0127C080914901E1 +:1003800090914A01A0914B01B0914C0180589E433D +:10039000A040B0408093490190934A01A0934B0143 +:1003A000B0934C0180914D0190914E01A0914F016D +:1003B000B09150010196A11DB11D80934D01909304 +:1003C0004E01A0934F01B09350018091490190914B +:1003D0004A01A0914B01B0914C0181589E43A0402D +:1003E000B04060F6BF91AF919F918F912F910F9088 +:1003F0000FBE0F901F9018958FB7F89420914D0164 +:1004000030914E0140914F01509150018FBFB90181 +:10041000CA0108956FB7F89486B590E0A0E0B0E007 +:10042000A89B08C00097A105B10521F480E091E0E8 +:10043000A0E0B0E020914501309146014091470194 +:10044000509148016FBF542F432F322F2227280F7E +:10045000391F4A1F5B1F82E0220F331F441F551FA5 +:100460008A95D1F7B901CA010895EF92FF920F93CF +:100470001F937B018C018FB7F89440914D015091EF +:100480004E0160914F01709150018FBF2FB7F894CA +:1004900080914D0190914E01A0914F01B09150017A +:1004A0002FBF841B950BA60BB70BE816F9060A079E +:1004B0001B0760F71F910F91FF90EF900895019730 +:1004C00059F0FC01EE0FFF1FEE0FFF1F32978FB7A1 +:1004D000F8943197F1F78FBF0895789484B58260CE +:1004E00084BD84B5816084BD85B5826085BD85B5D8 +:1004F000816085BDEEE6F0E0808181608083E1E887 +:10050000F0E0808182608083808181608083E0E888 +:10051000F0E0808181608083E1EBF0E080818460A5 +:100520008083E0EBF0E0808181608083EAE7F0E0A7 +:10053000808184608083808182608083808181600B +:1005400080838081806880831092C1000895282F65 +:1005500030E0C90186569F4FFC0194912A573F4FC6 +:10056000F9018491882391F0E82FF0E0EE0FFF1F4E +:10057000E859FF4FA591B491662329F48C91909589 +:1005800089238C9308958C91892B8C930895482FFF +:1005900050E0CA0182559F4FFC012491CA01865642 +:1005A0009F4FFC0194914A575F4FFA0134913323D6 +:1005B000D1F1222331F1233021F4809180008F7713 +:1005C00005C0243031F4809180008F7D80938000BD +:1005D00018C0213019F484B58F7704C0223021F47B +:1005E00084B58F7D84BD0DC0263021F48091B0008C +:1005F0008F7705C0273029F48091B0008F7D8093DC +:10060000B000E32FF0E0EE0FFF1FEE58FF4FA59173 +:10061000B491662329F48C91909589238C93089545 +:100620008C91892B8C930895682F70E0CB018255B3 +:100630009F4FFC012491CB0186569F4FFC014491B2 +:100640006A577F4FFB019491992319F420E030E021 +:1006500038C0222331F1233021F4809180008F773C +:1006600005C0243031F4809180008F7D809380001C +:1006700018C0213019F484B58F7704C0223021F4DA +:1006800084B58F7D84BD0DC0263021F48091B000EB +:100690008F7705C0273029F48091B0008F7D80933B +:1006A000B000892F90E0880F991F84589F4FFC015C +:1006B000A591B4918C9120E030E0842311F021E0E9 +:1006C00030E0C90108951F920F920FB60F921124C6 +:1006D0002F933F934F935F936F937F938F939F934A +:1006E000AF93BF93EF93FF934091C600E091D10188 +:1006F000F091D201CF01019660E870E00E943309C9 +:100700009C018091D3019091D4012817390739F0C9 +:10071000EF5AFE4F40833093D2012093D101FF91D5 +:10072000EF91BF91AF919F918F917F916F915F9169 +:100730004F913F912F910F900FBE0F901F901895E2 +:100740008F92AF92CF92DF92EF92FF920F931F930F +:10075000DF93CF93CDB7DEB7FC0181E391E09183C6 +:100760008083738362835583448337832683118711 +:100770000087F386E286D586C486A68687868D8521 +:10078000808B8E85818BCF91DF911F910F91FF9090 +:10079000EF90DF90CF90AF908F9008958F92AF92AF +:1007A000CF92DF92EF92FF920F931F93DF93CF933D +:1007B000CDB7DEB7FC0181E391E091838083738341 +:1007C0006283558344833783268311870087F386AA +:1007D000E286D586C486A68687868D85808B8E85A3 +:1007E000818BCF91DF911F910F91FF90EF90DF9060 +:1007F000CF90AF908F900895AF92BF92CF92DF923B +:10080000EF92FF920F931F93CF93DF936C017A01C6 +:100810008B01DC011496AD90BC901597CB01BA0109 +:1008200022E030E040E050E00E946809205C3D4B4F +:10083000404F5F4FCA01B901A80197010E946809A2 +:10084000C901DA010197A109B109292F3A2F4B2FCC +:10085000552747FD5A950196A11DB11DE501288335 +:10086000E601EE81FF8181508083EA85FB8520814E +:1008700041E050E0CA010E8402C0880F991F0A941B +:10088000E2F7282B2083EA85FB852081CA010F84AB +:1008900002C0880F991F0A94E2F7282B2083EA856B +:1008A000FB858081088802C0440F551F0A94E2F737 +:1008B000842B8083DF91CF911F910F91FF90EF9058 +:1008C000DF90CF90BF90AF900895DC011296ED912C +:1008D000FC911397E058FF4F8191919180589F4F61 +:1008E00020813181821B930B60E870E00E94330904 +:1008F0000895CF93DF93DC011296ED91FC9113974D +:10090000EF01CE57DF4F48815981E058FF4F80817A +:100910009181E058F0408417950719F42FEF3FEFCD +:100920000CC0E40FF51F2081CA01019660E870E059 +:100930000E9433099983888330E0C901DF91CF9108 +:100940000895DC011296ED91FC911397EE57FF4F3D +:1009500080819181929382930895FC01A085B18555 +:1009600021898C9190E0022E02C0959587950A947A +:10097000E2F780FFF6CF0484F585E02D60830895CB +:1009800081E391E09093D6018093D50181E591E0D8 +:100990009093D8018093D70185EC90E09093DA0191 +:1009A0008093D90184EC90E09093DC018093DB018B +:1009B00080EC90E09093DE018093DD0181EC90E08B +:1009C0009093E0018093DF0186EC90E09093E20148 +:1009D0008093E10184E08093E30183E08093E4016C +:1009E00087E08093E50185E08093E6010895DC01CE +:1009F000ED91FC910190F081E02D09950895DC01C5 +:100A0000ED91FC910190F081E02D099508950F93EF +:100A10001F93CF93DF938C01EB0109C02196D8017E +:100A2000ED91FC910190F081E02DC801099568815C +:100A30006623A1F7DF91CF911F910F9108950F9336 +:100A40001F938C01DC01ED91FC910190F081E02D70 +:100A50006DE00995D801ED91FC910190F081E02DB8 +:100A6000C8016AE009951F910F9108950F931F9394 +:100A70008C01DC01ED91FC910190F081E02D099554 +:100A8000C8010E941F051F910F9108950F931F9396 +:100A90008C010E940705C8010E941F051F910F913C +:100AA00008950F931F938C01DC01ED91FC9101904F +:100AB000F081E02D0995C8010E941F051F910F913B +:100AC00008952F923F924F925F926F927F928F92F2 +:100AD0009F92AF92BF92CF92DF92EF92FF920F93CD +:100AE0001F93DF93CF93CDB7DEB7A0970FB6F894DF +:100AF000DEBF0FBECDBF1C016A017B014115510550 +:100B00006105710549F4DC01ED91FC910190F081E2 +:100B1000E02D60E3099554C0882499245401422EA5 +:100B200055246624772401E010E00C0F1D1F080DEA +:100B3000191DC701B601A30192010E944609F801DF +:100B400060830894811C911CA11CB11CC701B601D3 +:100B5000A30192010E944609C901DA016C017D01DD +:100B6000C114D104E104F104F1F681E0E82EF12C86 +:100B7000EC0EFD1EE80CF91C3E010894611C711C72 +:100B8000D501C4010197A109B1096C01C818D908A0 +:100B900014C0F601EE0DFF1D60816A3010F4605D37 +:100BA00001C0695CD101ED91FC910190F081E02DD3 +:100BB000C10109950894E108F1086E147F0449F712 +:100BC000A0960FB6F894DEBF0FBECDBFCF91DF91D8 +:100BD0001F910F91FF90EF90DF90CF90BF90AF905B +:100BE0009F908F907F906F905F904F903F902F904D +:100BF00008952AE00E94610508950F931F938C01C8 +:100C00000E94F905C8010E941F051F910F910895C8 +:100C1000AB0160E070E00E94F90508950F931F9307 +:100C20008C01AB0160E070E00E94F905C8010E94F0 +:100C30001F051F910F910895EF92FF920F931F933D +:100C4000CF93DF93EC017A018B0177FF0FC0E8812E +:100C5000F9810190F081E02D6DE2099510950095E4 +:100C6000F094E094E11CF11C011D111DCE01B801AE +:100C7000A7012AE00E946105DF91CF911F910F919A +:100C8000FF90EF9008950F931F938C010E941C0614 +:100C9000C8010E941F051F910F910895AB0166279F +:100CA00057FD6095762F0E941C0608950F931F93A1 +:100CB0008C01AB01662757FD6095762F0E941C06BC +:100CC000C8010E941F051F910F910895DC01211595 +:100CD000310541F4ED91FC910190F081E02D642FFC +:100CE000099508952A30310519F40E941C060895CB +:100CF0000E94610508950F931F938C010E94660660 +:100D0000C8010E941F051F910F9108959F92AF92F5 +:100D1000BF92CF92DF92EF92FF920F931F93CF93E8 +:100D2000DF93EC017A018B01922ECB01BA0120E016 +:100D300030E040E050E00E948107882364F4E881BD +:100D4000F9810190F081E02DCE016DE2099517FB4C +:100D5000109517F9109520E030E040E05FE3AA24F9 +:100D60000BC0CA01B90120E030E040E251E40E942A +:100D700085079B01AC01A394A91498F3C801B7019E +:100D80000E941D075B016C010E94F2077B018C0130 +:100D9000CE01B801A7010E94F905992029F0CE01E2 +:100DA00063E371E00E940705C801B7010E941E08B5 +:100DB0009B01AC01C601B5010E941C0720C020E0C8 +:100DC00030E040E251E40E94D0087B018C010E9497 +:100DD000ED075B016C01CC24B7FCC094DC2CCE0188 +:100DE000B601A5010E941C06C601B5010E9420089B +:100DF0009B01AC01C801B7010E941C079A9499207D +:100E0000F1F6DF91CF911F910F91FF90EF90DF905E +:100E1000CF90BF90AF909F90089522E00E948606E9 +:100E200008950F931F938C010E940D07C8010E9423 +:100E30001F051F910F9108955058BB27AA270ED068 +:100E400075C166D130F06BD120F031F49F3F11F4C1 +:100E50001EF45BC10EF4E095E7FB51C1E92F77D199 +:100E600080F3BA17620773078407950718F071F4C7 +:100E70009EF58FC10EF4E0950B2EBA2FA02D0B011D +:100E8000B90190010C01CA01A0011124FF27591BCF +:100E900099F0593F50F4503E68F11A16F040A22FD5 +:100EA000232F342F4427585FF3CF46953795279546 +:100EB000A795F0405395C9F77EF41F16BA0B620B45 +:100EC000730B840BBAF09150A1F0FF0FBB1F661F8C +:100ED000771F881FC2F70EC0BA0F621F731F841FCF +:100EE00048F4879577956795B795F7959E3F08F0F5 +:100EF000B3CF9395880F08F09927EE0F97958795B4 +:100F00000895D9D008F481E008950CD00FC107D11D +:100F100040F0FED030F021F45F3F19F0F0C05111E5 +:100F200039C1F3C014D198F39923C9F35523B1F310 +:100F3000951B550BBB27AA2762177307840738F048 +:100F40009F5F5F4F220F331F441FAA1FA9F333D0A7 +:100F50000E2E3AF0E0E830D091505040E695001C5B +:100F6000CAF729D0FE2F27D0660F771F881FBB1F17 +:100F7000261737074807AB07B0E809F0BB0B802DF1 +:100F8000BF01FF2793585F4F2AF09E3F510568F03D +:100F9000B6C000C15F3FECF3983EDCF386957795D1 +:100FA0006795B795F7959F5FC9F7880F911D96953F +:100FB000879597F90895E1E0660F771F881FBB1F9B +:100FC000621773078407BA0720F0621B730B840B48 +:100FD000BA0BEE1F88F7E095089504D06894B1111C +:100FE000D9C00895BCD088F09F5790F0B92F9927A9 +:100FF000B751A0F0D1F0660F771F881F991F1AF024 +:10100000BA95C9F712C0B13081F0C3D0B1E00895EC +:10101000C0C0672F782F8827B85F39F0B93FCCF36D +:10102000869577956795B395D9F73EF49095809519 +:10103000709561957F4F8F4F9F4F0895E89409C039 +:1010400097FB3EF490958095709561957F4F8F4FFB +:101050009F4F9923A9F0F92F96E9BB279395F69511 +:10106000879577956795B795F111F8CFFAF4BB0F8F +:1010700011F460FF1BC06F5F7F4F8F4F9F4F16C0F3 +:10108000882311F096E911C0772321F09EE8872F7D +:10109000762F05C0662371F096E8862F70E060E039 +:1010A0002AF09A95660F771F881FDAF7880F9695B2 +:1010B000879597F90895990F0008550FAA0BE0E856 +:1010C000FEEF16161706E807F907C0F0121613060A +:1010D000E407F50798F0621B730B840B950B39F44A +:1010E0000A2661F0232B242B252B21F408950A26B0 +:1010F00009F4A140A6958FEF811D811D089597F9F0 +:101100009F6780E870E060E008959FEF80EC0895AD +:1011100000240A94161617061806090608950024D6 +:101120000A9412161306140605060895092E039450 +:10113000000C11F4882352F0BB0F40F4BF2B11F4C4 +:1011400060FF04C06F5F7F4F8F4F9F4F089557FD23 +:101150009058440F551F59F05F3F71F04795880F25 +:1011600097FB991F61F09F3F79F0879508951216BC +:1011700013061406551FF2CF4695F1DF08C0161668 +:1011800017061806991FF1CF869571056105089419 +:101190000895E894BB2766277727CB0197F9089530 +:1011A0000BD0C4CFB5DF28F0BADF18F0952309F0D3 +:1011B000A6CFABCF1124EECFCADFA0F3959FD1F31A +:1011C000950F50E0551F629FF001729FBB27F00DF5 +:1011D000B11D639FAA27F00DB11DAA1F649F66274A +:1011E000B00DA11D661F829F2227B00DA11D621F99 +:1011F000739FB00DA11D621F839FA00D611D221F53 +:10120000749F3327A00D611D231F849F600D211D36 +:10121000822F762F6A2F11249F5750408AF0E1F0D9 +:1012200088234AF0EE0FFF1FBB1F661F771F881F22 +:1012300091505040A9F79E3F510570F060CFAACF62 +:101240005F3FECF3983EDCF3869577956795B7950D +:10125000F795E7959F5FC1F7FE2B880F911D969537 +:10126000879597F9089597FB092E07260AD077FDF1 +:1012700004D049D006D000201AF4709561957F4FB4 +:101280000895F6F7909581959F4F0895A1E21A2E43 +:10129000AA1BBB1BFD010DC0AA1FBB1FEE1FFF1F1A +:1012A000A217B307E407F50720F0A21BB30BE40B6A +:1012B000F50B661F771F881F991F1A9469F76095B1 +:1012C0007095809590959B01AC01BD01CF0108956B +:1012D00097FB092E05260ED057FD04D0D7DF0AD084 +:1012E000001C38F450954095309521953F4F4F4F55 +:1012F0005F4F0895F6F790958095709561957F4FB3 +:101300008F4F9F4F0895AA1BBB1B51E107C0AA1F17 +:10131000BB1FA617B70710F0A61BB70B881F991F96 +:101320005A95A9F780959095BC01CD010895EE0FCF +:0E133000FF1F0590F491E02D0994F894FFCF73 +:10133E00090113011D0127010104011000140120F0 +:10134E000000000C0110001C012000000004011020 +:10135E00001C0120000000040180000000000000BD +:06136E0000AD042E00009A +:00000001FF diff --git a/rf433rcv/arduino b/rf433rcv/arduino new file mode 120000 index 0000000..3e9ad92 --- /dev/null +++ b/rf433rcv/arduino @@ -0,0 +1 @@ +/home/realraum/arduino-0022 \ No newline at end of file diff --git a/rf433rcv/lala b/rf433rcv/lala new file mode 100644 index 0000000..8d61242 --- /dev/null +++ b/rf433rcv/lala @@ -0,0 +1 @@ +1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,0,1,0,1,0,1,1,1,0,1,0,1,0,0,0,0,1,1,1,1,0,1,1,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,0,1,0,1,0,0,0,0,1,1,1,1,1,1,0,1,1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0,1,0,0,0,1,1,1,1,1,0,1,1,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,1,0,0,0,0,1,1,1,0,0,1,1,1,1,0,0,1,1,1,1,0,1,1,0,1,0,1,1,0,1,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,0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,1,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,0,1,1,1,0,1,1,0,1,1,0,0,1,1,1,1,0,0,0,1,1,1,0,1,1,1,1,1,1,0,1,0,0,0,1,1,0,1,0,0,0,1,1,1,0,0,0,0,1,1,0,0,1,0,0,1,0,0,0,1,0,0,0,1,0,0,1,1,1,0,1,1,1,1,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,0,1,1,1,0,1,1,1,1,0,0,0,1,1,1,0,1,0,0,1,1,1,0,1,1,1,0,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,0,1,0,0,1,0,0,0,1,1,0,0,1,0,0,1,0,0,0,1,0,0,0,1,1,1,1,1,1,0,1,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,1,1,1,0,1,1,1,0,1,0,0,1,1,1,0,1,1,0,1,1,1,0,1,1,1,0,1,1,0,1,0,0,0,1,1,1,0,1,0,0,1,1,1,0,1,0,0,0,1,0,1,0,0,0,1,0,0,0,1,1,0,1,1,1,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,1,1,1,1,0,1,1,1,0,1,0,0,1,1,1,0,1,0,0,0,1,1,0,1,1,1,0,1,1,1,0,0,0,0,1,1,1,1,1,0,0,1,1,1,0, \ No newline at end of file diff --git a/rf433rcv/pc.cpp b/rf433rcv/pc.cpp index 6f43deb..34392c3 100644 --- a/rf433rcv/pc.cpp +++ b/rf433rcv/pc.cpp @@ -5,9 +5,10 @@ int main() unsigned char c =0; unsigned char sym =0; int counter = 1000; - while( counter--) +// while( counter--) +// { + while( std::cin >> c) { - std::cin >> c; for(int i = 0; i<8; i++) { sym = c & (1<<7); diff --git a/rf433rcv/plot.py b/rf433rcv/plot.py index 350c40a..7afae9c 100755 --- a/rf433rcv/plot.py +++ b/rf433rcv/plot.py @@ -5,6 +5,7 @@ import numpy import pylab for line in fileinput.input(): + line = line[0:-1] data = numpy.array(line.split(",")) pylab.plot(range(len(data)),data) pylab.show() diff --git a/rf433rcv/rf433rcv.cpp b/rf433rcv/rf433rcv.cpp new file mode 100644 index 0000000..3e05fec --- /dev/null +++ b/rf433rcv/rf433rcv.cpp @@ -0,0 +1,209 @@ +#include +#include +#include +#define RF433_PIN 0 +//********************************************************************// + +typedef unsigned char byte; + +typedef struct { + byte offset; + byte state; +} rf_bit_t; + +// offset is number of alphas (0.08ms) + +const rf_bit_t zero_bit[] = { { 4, 1 }, + { 16, 0 }, + { 20, 1 }, + { 32, 0 }, + { 0, 0 } }; + +const rf_bit_t one_bit[] = { { 12, 1 }, + { 16, 0 }, + { 28, 1 }, + { 32, 0 }, + { 0, 0 } }; + +const rf_bit_t float_bit[] = { { 4, 1 }, + { 16, 0 }, + { 28, 1 }, + { 32, 0 }, + { 0, 0 } }; + +const rf_bit_t sync_bit[] = { { 4, 1 }, + { 128, 0 }, + { 0, 0 } }; + +typedef enum { ZERO = 0, ONE , FLOAT , SYNC } adbit_t; +typedef byte ad_bit_t; +#define WORD_LEN 13 +typedef ad_bit_t word_t[WORD_LEN]; + +const rf_bit_t* bit_defs[] = { zero_bit, one_bit, float_bit, sync_bit }; + +byte alpha_cnt = 0; +byte bit_cnt = 0; +byte chunk_cnt = 0; +byte word_cnt = 0; +const ad_bit_t* current_word; +byte volatile frame_finished = 1; + +#define FRAME_LEN 8 + +#define A1_ON 0 +#define A1_OFF 1 +#define A2_ON 2 +#define A2_OFF 3 + +#define B1_ON 4 +#define B1_OFF 5 +#define B2_ON 6 +#define B2_OFF 7 + +#define C1_ON 8 +#define C1_OFF 9 +#define C2_ON 10 +#define C2_OFF 11 + +#define D1_ON 12 +#define D1_OFF 13 +#define D2_ON 14 +#define D2_OFF 15 + +const word_t words[] = { +{ ZERO, ZERO, FLOAT, FLOAT, ZERO, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, FLOAT, SYNC }, // A1_ON +{ ZERO, ZERO, FLOAT, FLOAT, ZERO, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, SYNC }, // A1_OFF +{ ZERO, ZERO, FLOAT, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, FLOAT, SYNC }, // A2_ON +{ ZERO, ZERO, FLOAT, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, SYNC }, // A2_OFF + +{ FLOAT, ZERO, FLOAT, FLOAT, ZERO, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, FLOAT, SYNC }, // B1_ON +{ FLOAT, ZERO, FLOAT, FLOAT, ZERO, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, SYNC }, // B1_OFF +{ FLOAT, ZERO, FLOAT, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, FLOAT, SYNC }, // B2_ON +{ FLOAT, ZERO, FLOAT, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, SYNC }, // B2_OFF + +{ ZERO, FLOAT, FLOAT, FLOAT, ZERO, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, FLOAT, SYNC }, // C1_ON +{ ZERO, FLOAT, FLOAT, FLOAT, ZERO, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, SYNC }, // C1_OFF +{ ZERO, FLOAT, FLOAT, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, FLOAT, SYNC }, // C2_ON +{ ZERO, FLOAT, FLOAT, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, SYNC }, // C2_OFF + +{ FLOAT, FLOAT, FLOAT, FLOAT, ZERO, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, FLOAT, SYNC }, // D1_ON +{ FLOAT, FLOAT, FLOAT, FLOAT, ZERO, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, SYNC }, // D1_OFF +{ FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, FLOAT, SYNC }, // D2_ON +{ FLOAT, FLOAT, FLOAT, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, FLOAT, FLOAT, ZERO, SYNC } // D2_OFF +}; + + +//********************************************************************// + +void start_timer() +{ + // timer 1: 2 ms + TCCR1A = 0; // prescaler 1:8, WGM = 4 (CTC) + TCCR1B = 1< 0.08ms @ 16 MHz -> 1*alpha +// OCR1A = 207; // (1+207)*8 = 1664 -> 0.104ms @ 16 MHz -> 1*alpha + TCNT1 = 0; // reseting timer + TIMSK1 = 1< 2 && rf433_lo_cnt<6 && rf433_hi_cnt>10 && rf433_hi_cnt < 14) + { + rf433_data.uint32<<=1; + rf433_data.uint32|=1; + valid++; + } else if (rf433_hi_cnt > 2 && rf433_hi_cnt<6 && rf433_lo_cnt>10 && rf433_lo_cnt < 14) { + rf433_data.uint32<<=1; + valid++; + } else if (rf433_hi_cnt > 2 && rf433_hi_cnt<6 && rf433_lo_cnt>120 && rf433_lo_cnt < 128 && valid >=24) { + //rf433_data.uint8[3]=0; + //Serial.print(rf433_data.uint32); + Serial.print(rf433_data.uint8[0],BYTE); + Serial.print(rf433_data.uint8[1],BYTE); + Serial.print(rf433_data.uint8[2],BYTE); + //Serial.print(rf433_data.uint8[3],BYTE); + } else { + valid=0; + rf433_data.uint32=0; + } + rf433_hi_cnt=0; + rf433_lo_cnt=0; + } + if (sample == HIGH) + rf433_hi_cnt++; + else + rf433_lo_cnt++; + last_sample=sample; +} + +//unsigned long wm_start_[3]={0,0,0}; +//bool wait_millis(unsigned long *start_time, unsigned long ms) +//{ +// if (ms == 0) +// return false; +// else if (*start_time > 0) +// { +// if (millis() < *start_time || millis() > (*start_time) + ms) +// { +// *start_time = 0; +// return false; +// } +// else +// return true; +// } +// else +// { +// *start_time=millis(); +// return true; +// } +//} + +//********************************************************************// + +void setup() +{ + pinMode(RF433_PIN, INPUT); // set pin to input + digitalWrite(RF433_PIN, LOW); // turn of pullup resistors + + Serial.begin(57600); +// Serial.println("starting timer"); + start_timer(); +} + + +void loop() +{ +} + +int main(void) +{ + init(); + + setup(); + + for (;;) + loop(); + + return 0; +} + diff --git a/rf433rcv/test b/rf433rcv/test new file mode 100644 index 0000000..49e103e Binary files /dev/null and b/rf433rcv/test differ