Code Monkey home page Code Monkey logo

openast's Introduction

NEW! Arduino code

I strongly recomend switching to the arduino based code. All future changes will be made here. It is much more easy to work with now that I have managed to get the critical timings right to send a correct signal.

To add support for attiny in Arduino follow this guide https://create.arduino.cc/projecthub/arjun/programming-attiny85-with-arduino-uno-afb829

Do note that if you try to program your attiny mounted in the transponder you need to desolder the resistor on the antenna loop or the device will not respond correctly ( giving wrong board id errors and not responding well at all etc...) And you still need to supply the chip with an own oscilator source because it do not like to use the 20mhz crystal in programming mode for some reason.

openAST

open source Axx Simulated transponder

This is for an attiny25 running at 20MHz

set fuse to -U lfuse:w:0xff:m in avrdude

To use the java program to encode run:

cd encoderProgram/java/dist
java -jar rctcode.jar 3456789

encode2: 0101001000010111011001000101010000000000
encodeOut:  1110000111001011111111010010100100101000000100110001110100010011001111110000
    ldi  d1,  0xe1
    ldi  d2,  0xcb
    ldi  d3,  0xfd
    ldi  d4,  0x29
    ldi  d5,  0x28
    ldi  d6,  0x13
    ldi  d7,  0x1d
    ldi  d8,  0x13
    ldi  d9,  0x3f

And the last lines you can paste in the asm file when you build your program and you have it ready to go.

To decode, input a binary string as argument (at least 12 char)

java -jar rctcode.jar 1110000111001011111111010010100100101000000100110001110100010011001111110000
  known decoded: 01010010000101110110010001010100000000
  known decoded int: 3456789

openast's People

Contributors

condac avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

openast's Issues

schematic problem

I think the diode at the input is backwards, if the connector P1 is the power supply plug connector.
I built one from your schematic and it seems to work ok, the led is blinking. Now just need to test it on my decoder loop and see if it picks up. This is on the transponder schematic.

Modify arduinoISP to generate clock source for programming of attiny

Investigate if following code can generate a 4mhz clock and if it works to program a attiny with external clock bit set.

/*
    Prorotype Code for 1-4MHz PWM 50% Duty Cycle
    ICR1 as TOP = crystal / (2*Prescale*Fpwm)    in MODE 9
    
    
    at 16000000MHz   64 Prescale PWM Fmax = 62.5KHz 
    at 16000000MHz    8 Prescale PWM Fmax = 500KHz
    at 16000000MHz    1 Prescale PWM Fmax = 4MHz
    
*/

void setup(){

  pinMode(9, OUTPUT);                              // OCR1A Output
  
  pinMode(10, OUTPUT);                             // Just test LED on OCR1B Generally LED
  digitalWrite(10, LOW);
  delay(1000);
  digitalWrite(10, HIGH);
  
//phase/frequency correct mode. 

TCCR1A = _BV(COM1A1);                                               // Enable OCR1A 
//TCCR1A = _BV(COM1A1) | _BV(COM1B1) ;                      // Enable OCR1A and OCAR1B 
// TCCR1A = _BV(COM1A1) | _BV(COM1B1) | _BV(COM1A0) | _BV(COM1B0); 

//TCCR1B = _BV(WGM13) | _BV(CS11);                                  // Set Prescale Clock 8 and Mode 9
TCCR1B = _BV(WGM13) | _BV(CS10);                                    // Set Prescale Clock 1 and Mode 9
}

void loop(){

//ICR minimum 2   F = 16000000MHz  No Change if using 14.7456MHz very close for fucking lazy bitch. and I don't need precision PWM at all.

16.MHz Xtal for PWM Frequency while 14.7456MHz for Precision Baudrate RS232/RS485/RS422

/*make this variable as table.
//ICR1 = 10,000;                     // 100Hz w/16MHz Prescale 8
//ICR1 = 5,000;                      // 200Hz w/16MHz Prescale 8

//TEST 500MHZ MAX
//ICR1 = 2;                            // 500KHz w/16MHz Prescale 8

// Test 4MHZ  MAX
ICR1 = 2;                                // 4MHz w/ 1600000MHz Prescale 1


OCR1A = ICR1 / 2;                    // 50 Duty of ICR1
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.