Hello Everyone!
I am currently working with a ATTiny84 and writing a software UART in C++.
I wrote this code and it works great! I transmit without missing a beat.
Now this code how ever. I've tested by sending one byte at a time and it works fine. but the moment multiple bytes come thourgh they come out all garbage. Anyone have a reason why or maybe can point me toward a already written peice that I may use. I've been working on this issue for three days stright now and i am stumped.
Datasheet is here http://www.atmel.com/Images/doc8006.pdf
GPS DataSheet http://www.cytron.com.my/usr_attachment/SkyNav SKM53 Datasheet.pdf
Code uploaded here
http://codeviewer.org/view/code:303a
I am currently working with a ATTiny84 and writing a software UART in C++.
I wrote this code and it works great! I transmit without missing a beat.
Rich (BB code):
#define sleepTransmitString9600 70
void transmitS9600(charStringToSend[],intPAPin)
{
int a=0;
while(StringToSend[a]!=0x0)//Look for Null Terminator
{
if(StringToSend[a]>127)
{
a++;
continue;
}
// low for start bit
PORTA&=~(1<<PAPin);//Startbit
_delay_us(sleepTransmitString9600);
// data bits
for(inti=0;i<=7;i++)
{
if(StringToSend[a]&(1<<i))
{
PORTA|=(1<<PAPin);
}
else
{
PORTA&=~(1<<PAPin);
}
_delay_us(sleepTransmitString9600);
}
PORTA|=(1<<PAPin);//Stopbit
_delay_us(sleepTransmitString9600*4);
a++;
}
}
Now this code how ever. I've tested by sending one byte at a time and it works fine. but the moment multiple bytes come thourgh they come out all garbage. Anyone have a reason why or maybe can point me toward a already written peice that I may use. I've been working on this issue for three days stright now and i am stumped.
Datasheet is here http://www.atmel.com/Images/doc8006.pdf
GPS DataSheet http://www.cytron.com.my/usr_attachment/SkyNav SKM53 Datasheet.pdf
Code uploaded here
http://codeviewer.org/view/code:303a