tomaskovacik / vwcdavr

AVR alternative to vwcdpic HW+SW
54 stars 35 forks source link

ATtiny 2313 Support #21

Open tengzl33t opened 1 month ago

tengzl33t commented 1 month ago

Hello, can it be ported to ATtiny 2313 with Blaupunkt MCD RNS button support added? There is already existing firmware for it, but without button support and no source code available.

RNS button actions -> ATtiny -> Bluetooth module button inputs

Thank you. Emulator MCD.zip

tomaskovacik commented 1 month ago

if firmware is based on vwcdavr, then source code should be bundled with it, with all changes, it is GNU GPL v2 licensed: https://github.com/tomaskovacik/vwcdavr/blob/master/CDC_emulator/cdc_arduino_ported_k9spud_vwcdpic/LICENSE.md

ask author of firmware, he/she should be honest about source.

anyway, I do not have much time to port it to 2313, and I do not have board on hand :/

tomaskovacik commented 1 month ago

attiny2313_4313.zip I did a quick look at datasheet and add som defines to select proper registers:

|| defined(__AVR_ATtiny4313__)

try attached code, pin outputs are defined here:

#if defined(__AVR_ATtiny85__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny4313__)
#define RADIO_COMMAND      PB2
#define RADIO_COMMAND_DDR  DDRB
#define RADIO_COMMAND_PORT PORTB
#define RADIO_COMMAND_PIN  PINB
#define RADIO_CLOCK        PB1
#define RADIO_CLOCK_DDR    DDRB
#define RADIO_CLOCK_PORT   PORTB
#define RADIO_CLOCK_PIN    PINB
#define RADIO_DATA         PB0
#define RADIO_DATA_DDR     DDRB
#define RADIO_DATA_PORT    PORTB
tengzl33t commented 1 month ago

Unfortunately, I was not able to get any replies from some of the potential devs of that firmware. So looks like it is not possible to get any sources now.

Is it possible to maintain the same pins in use, like how they are used in the project I sent in the first message to not rebuild the board?

I have also mentioned forwarding the radio button actions to the Bluetooth module. I think this could be done with converting the codes got from radio to 3.3V High levels on desired pins.

Thank you.

tomaskovacik commented 1 month ago

well, I changes pins on attached firmware, you should really do it your self, it was easy as changing 16 pins definitions which I wrote you in prev. comment ... regarding controlling bluetooth module, that is out of my reach, I do not know which module you have, I do not have that radio .... so it is up to you :) firm.zip