380.9Khz IC capture


hey all,

a bit of newbie in arduino world, got kit week ago, must admit. have ic running @ 370900hz (it's key encoder, on composite video signal), , matching decoder buried in rack there's no chance of swapping out ics.

anyway, ic is, expect, encoding parallel serial, , pumping out on tx. have been given task of replicating entirely using atmega328pu. that's capturing serial data, intention of pumping out @ later date independently encoder.

so timer setting gets desired khz:

quote
void setup()
{
 serial.begin(9600);

 tccr0a = (1 << wgm01);
 tccr0b = (1 << cs00);
 ocr0a = 42;
 //ocr0b = 42; // flip flop
 timsk0 = (1 << ocie0a); //| (1 << ocie0b);
 sei();

 ddrd = 0x00; //portd set input
 ddrb = 0xff;
}
i've been toying idea of running 2 timers, i'll digress later.


quote
byte datas = 0x00;
isr(timer0_compa_vect)
{
 datas = pind;
 portb = datas;
this bit catches vector/interrupt, , testing purposes it's routing 8bit register pind portb. direct pin extraction bit arduino. pin 2 on arduino input, equals pin 11 output. did test khz working, can use in live environment.

now onto question, fighting losing battle here? have read many people 370±khz bit ambitious.

say if do: data = pind; i++; way out of sync.

my oscilloscope reading around 370khz, 15ms burst, , datasheet ic says waits bit before transmitting simple 2 word serial transmission.

is there quick , efficient way stream bits directly memory address, stack? considering running timer twice fast, , every operation takes byte , saves it. whole timer operation activated falling interrupt.

e.g.:

quote
boolean flipflop = false;
isr(timer0_compb_vect)
{
 if (flipflop)
 {
 data [ ] = datas;
 }

 flipflop = !flipflop;
}
should wait use oscilloscope analyse serial data , build arrays there?

just make aware, have tried spi library , getting chip slave mode. ic have clock / oscillator, , low ss, genuinely thought getting somewhere. alas, getting way doing it.


Arduino Forum > Using Arduino > Project Guidance > 380.9Khz IC capture


arduino

Comments