THE HARRASMENT IS BACK!!!
The setup:
two atmega8L-PU on seperate boards .. independent power supply and other components including 4 LEDs on each
The first atmega8 has a ASK 434MHZ RF Transmitter module connected to its Tx pin
The second one has a ASK 434MHZ RF Receiver module connected to its Rx pin
both tuned to same Baud rate & have appropriate antenna's attached
also both atmega 8 have same 1MHz internal clock
NOTE:- the circuit path goes close to each other (I dont think it is causing any cross talk ! is it?)
The Algorithm
the atmega8 with the transmitter makes few ADC conversions and selects a byte from group of 4 pre defined bytes on basis of the result and sends it to the Uart ...directly writing the byte to UDR and then polling(waiting) till it is sent the sent byte is also shown by its LED.. then it repeats the procedure from ADC calcuations
the second atmega8(receiver) has 4 LED that light up on basis of received data byte.. each corresponding to one byte from the 4;
Transmitter LOGIC
THE HARRASSMENT
EVERYTHING IS *BEEP*ED UP
the receiver listens sometime and sometime it ignores the transmitter completely.
one of the LED corresponding to byte 0xff will mostly light up but others only flicker (error in received data causing rapid on/off) while some may never light up
and sometimes the wrong LED lights up for the byte
however if I send a single byte repeatedly without any ADC and other calculation it works fine!
that said the link between RF modules are correct!
But the data gets out of sync quickly
I tried different baudrates,internal clock frequencies,stop bits as well as different data bytes and even changing between polling and interrupt methods (interuppt made it worse) and hell! also changed the optimisation levels
NO RESULTS
The thinking
I think there are two major culprits the internal clock and the noise prone transmission
I have heard the ATMEGA8 has a bad Internal clock a so they both get out of sync quickly
also as I increase the BAUD rate the situation becomes worse
on the noise side the byte with more ONES (1) in upper nibble are received more than those having mostly 0
I think since its ASK there is a probablity that if you transmit zeros there is more room for noise to take over (ASK only)
HELP ME
The setup:
two atmega8L-PU on seperate boards .. independent power supply and other components including 4 LEDs on each
The first atmega8 has a ASK 434MHZ RF Transmitter module connected to its Tx pin
The second one has a ASK 434MHZ RF Receiver module connected to its Rx pin
both tuned to same Baud rate & have appropriate antenna's attached
also both atmega 8 have same 1MHz internal clock
NOTE:- the circuit path goes close to each other (I dont think it is causing any cross talk ! is it?)
The Algorithm
the atmega8 with the transmitter makes few ADC conversions and selects a byte from group of 4 pre defined bytes on basis of the result and sends it to the Uart ...directly writing the byte to UDR and then polling(waiting) till it is sent the sent byte is also shown by its LED.. then it repeats the procedure from ADC calcuations
the second atmega8(receiver) has 4 LED that light up on basis of received data byte.. each corresponding to one byte from the 4;
Transmitter LOGIC
Rich (BB code):
for(i=1;i<5;i++)
{
if(getADC(i)>((max[i-1]+min[i-1])/2))
{
switch(i){
case 1:
byte=0xff;
break;
case 2:
byte=0xfe;
break;
case 3:
byte|=0xfd;
break;
case 4:
byte|=0xfc;
break;
};
dpadSelective(i,1);
}
else
dpadSelective(i,0);
}//end for
if(state==transmitting)
sendByte( byte);
}
void sendByte(int byte){
UDR = byte;
while (( UCSRA & (1 << TXC )) == 0) {};
}
EVERYTHING IS *BEEP*ED UP
the receiver listens sometime and sometime it ignores the transmitter completely.
one of the LED corresponding to byte 0xff will mostly light up but others only flicker (error in received data causing rapid on/off) while some may never light up
and sometimes the wrong LED lights up for the byte
however if I send a single byte repeatedly without any ADC and other calculation it works fine!
that said the link between RF modules are correct!
But the data gets out of sync quickly
I tried different baudrates,internal clock frequencies,stop bits as well as different data bytes and even changing between polling and interrupt methods (interuppt made it worse) and hell! also changed the optimisation levels
NO RESULTS
The thinking
I think there are two major culprits the internal clock and the noise prone transmission
I have heard the ATMEGA8 has a bad Internal clock a so they both get out of sync quickly
also as I increase the BAUD rate the situation becomes worse
on the noise side the byte with more ONES (1) in upper nibble are received more than those having mostly 0
I think since its ASK there is a probablity that if you transmit zeros there is more room for noise to take over (ASK only)
HELP ME
Last edited by a moderator: