Skip to content

Commit

Permalink
fix(RF)small freq change
Browse files Browse the repository at this point in the history
feat(build)mbus target
  • Loading branch information
smarthomeagentur committed Dec 21, 2020
1 parent e7ad15d commit 180dcb5
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 6,905 deletions.
766 changes: 0 additions & 766 deletions culfw/Devices/CUL/CUL_V2.hex

This file was deleted.

769 changes: 0 additions & 769 deletions culfw/Devices/CUL/CUL_V2_HM.hex

This file was deleted.

791 changes: 0 additions & 791 deletions culfw/Devices/CUL/CUL_V2_MAX.hex

This file was deleted.

1,501 changes: 0 additions & 1,501 deletions culfw/Devices/CUL/CUL_V3.hex

This file was deleted.

1,591 changes: 0 additions & 1,591 deletions culfw/Devices/CUL/CUL_V3_ZWAVE.hex

This file was deleted.

1,462 changes: 0 additions & 1,462 deletions culfw/Devices/CUL/CUL_V4.hex

This file was deleted.

54 changes: 35 additions & 19 deletions culfw/Devices/CUL/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,24 +27,28 @@
#define CUL_V3
#endif

#if defined(CUL_V3_MBUS)
#define CUL_V3
#endif

#if defined(CUL_V3) || defined(CUL_V4)
#define HAS_FHT_8v // PROGMEM: 586b RAM: 23b
#define HAS_FHT_TF
#define FHTBUF_SIZE 174 // RAM: 174b
#define RCV_BUCKETS 4 // RAM: 25b * bucket
#define FULL_CC1100_PA // PROGMEM: 108b
#define HAS_RAWSEND //
#define HAS_ASKSIN // PROGMEM: 1314
#define HAS_ASKSIN_FUP // PROGMEM: 78
#define HAS_MORITZ // PROGMEM: 1696
#define HAS_ESA // PROGMEM: 286
#define HAS_TX3 // PROGMEM: 168
#define HAS_INTERTECHNO // PROGMEM: 1352
#define HAS_TCM97001 // PROGMEM: 264
#define HAS_UNIROLL // PROGMEM: 92
#define HAS_MEMFN // PROGMEM: 168
//# define HAS_SOMFY_RTS // PROGMEM: 1716
#define HAS_BELFOX // PROGMEM: 214
# define HAS_FHT_8v // PROGMEM: 586b RAM: 23b
# define HAS_FHT_TF
# define FHTBUF_SIZE 174 // RAM: 174b
# define RCV_BUCKETS 4 // RAM: 25b * bucket
# define FULL_CC1100_PA // PROGMEM: 108b
# define HAS_RAWSEND //
# define HAS_ASKSIN // PROGMEM: 1314
# define HAS_ASKSIN_FUP // PROGMEM: 78
# define HAS_MORITZ // PROGMEM: 1696
# define HAS_ESA // PROGMEM: 286
# define HAS_TX3 // PROGMEM: 168
# define HAS_INTERTECHNO // PROGMEM: 1352
# define HAS_TCM97001 // PROGMEM: 264
# define HAS_UNIROLL // PROGMEM: 92
# define HAS_MEMFN // PROGMEM: 168
# define HAS_SOMFY_RTS // PROGMEM: 1716
# define HAS_BELFOX // PROGMEM: 214
#endif

#if defined(CUL_V4)
Expand All @@ -54,12 +58,12 @@

#if defined(CUL_V3)
#define TTY_BUFSIZE 128 // RAM: TTY_BUFSIZE*4
#define HAS_MBUS // PROGMEM: 4255
# undef HAS_MBUS // PROGMEM: 4255
#if defined(HAS_MBUS)
#define MBUS_NO_TX // PROGMEM: 962
#endif
#define HAS_RFNATIVE // PROGMEM: 580
//# define HAS_KOPP_FC // PROGMEM: 3370
# define HAS_KOPP_FC // PROGMEM: 3370
#endif

#if defined(CUL_V3_ZWAVE)
Expand All @@ -71,6 +75,18 @@
#define HAS_EVOHOME
#endif

#if defined(CUL_V3_MBUS)
#undef HAS_ZWAVE // PROGMEM: 882
#define HAS_MBUS
#if defined(HAS_MBUS)
#define MBUS_NO_TX // PROGMEM: 962
#endif
#undef HAS_KOPP_FC
#undef HAS_RFNATIVE
#undef LACROSSE_HMS_EMU // PROGMEM: 2206
#define HAS_EVOHOME
#endif

#ifdef CUL_V2
#define TTY_BUFSIZE 48
#define FHTBUF_SIZE 74
Expand Down
15 changes: 12 additions & 3 deletions culfw/Devices/CUL/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,14 @@ ifeq ($(TARGET), CUL_V3)
SRC += ../../clib/rf_mbus.c ../../clib/mbus/manchester.c ../../clib/mbus/3outof6.c ../../clib/mbus/mbus_packet.c ../../clib/mbus/crc.c
endif

ifeq ($(TARGET), CUL_V3_MBUS)
SRC += ../../clib/rf_mbus.c ../../clib/mbus/manchester.c ../../clib/mbus/3outof6.c ../../clib/mbus/mbus_packet.c ../../clib/mbus/crc.c
endif

all:
make TARGET=CUL_V3 MCU=atmega32u4 mostly_clean build size
#make TARGET=CUL_V3_ZWAVE MCU=atmega32u4 mostly_clean build size
make TARGET=CUL_V3_MBUS MCU=atmega32u4 mostly_clean build size
make TARGET=CUL_V3_ZWAVE MCU=atmega32u4 mostly_clean build size

build: elf hex eep lss sym

Expand All @@ -125,7 +130,7 @@ size:


usbprogram:
@echo 'specify one of: usbprogram_v2 usbprogram_v2_hm usbprogram_v3 usbprogram_v4'
@echo 'specify one of: usbprogram_v2 usbprogram_v2_hm usbprogram_v3 usbprogram_v3_mbus usbprogram_v4'

usbprogram_v4: TARGET=CUL_V4
usbprogram_v4: MCU=atmega32u2
Expand All @@ -135,6 +140,10 @@ usbprogram_v3: TARGET=CUL_V3
usbprogram_v3: MCU=atmega32u4
usbprogram_v3: do_usbprogram

usbprogram_v3_mbus: TARGET=CUL_V3
usbprogram_v3_mbus: MCU=atmega32u4
usbprogram_v3_mbus: do_usbprogram

usbprogram_v2: TARGET=CUL_V2
usbprogram_v2: MCU=at90usb162
usbprogram_v2: do_usbprogram
Expand Down Expand Up @@ -198,7 +207,7 @@ mostly_clean:
@$(REMOVE) $(SRC:.c=.i)

clean: mostly_clean
@$(REMOVE) *.hex
#@$(REMOVE) *.hex
@$(REMOVE) *.eep
@$(REMOVE) *.cof
@$(REMOVE) *.elf
Expand Down
2 changes: 1 addition & 1 deletion culfw/clib/kopp-fc.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ const PROGMEM const uint8_t CC1100_Kopp_CFG[EE_CC1100_CFG_SIZE] = {
0x00, // 0C FSCTRL0 00 00 Frequency Offset = 0
0x21, // 0D FREQ2 *1E 21 FREQ[23..0] = f(carrier)/f(XOSC)*2^16 -> 868,3Mhz / 26Mhz * 2^16 = 2188650 dez = 21656A hex (f(XOSC)=26 Mhz)
0x65, // 0E FREQ1 *C4 65 s.o.
0xCA, // 0F FREQ0 *EC e8 s.o.
0xB0, // 0F FREQ0 *EC e8 s.o.
0x97, // 10 MDMCFG4 *8C 55 bWidth 162,5 kHz (Kopp 50 Khz!, but does not work))
0x83, // 11 MDMCFG3 *22 *43 Drate: 4785,5 Baud (Kopp: 4789 Baud, measured value !! may be increase by 1 is needed (83) because value should be 4800) doesn't work better with 81/83 )
0x16, // 12 MDMCFG2 *02 *B0 DC Blocking filter enabled, GFSK modulation (Kopp uses FSK, do not know whether 2-FSK, GFSK odr 4-FSK),
Expand Down
2 changes: 1 addition & 1 deletion culfw/clib/rf_evohome.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ const uint8_t PROGMEM EVOHOME_CFG_ASYNC_38400[] = {

CC1100_FREQ2, 0x21, // 0D Frequency control word, high byte 868.4MHz
CC1100_FREQ1, 0x65, // 0E Frequency control word, middle byte
CC1100_FREQ0, 0xcc, // 0F Frequency control word, low byte
CC1100_FREQ0, 0xb0, // 0F Frequency control word, low byte
CC1100_MDMCFG4, 0x6a, // 10 Modem configuration
CC1100_MDMCFG3, 0x83, // 11 Modem configuration
CC1100_MDMCFG2, 0x10, // 12 Modem configuration GFSK/No Manchester, preamble or sync
Expand Down
2 changes: 1 addition & 1 deletion culfw/clib/rf_rwe.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const uint8_t PROGMEM RWE_CFG[60] = {
0x0B, 0x06,
0x0D, 0x21,
0x0E, 0x65,
0x0F, 0xCA,
0x0F, 0xB0,
0x10, 0xC8,
0x11, 0x93,
0x12, 0x03,
Expand Down

0 comments on commit 180dcb5

Please sign in to comment.