Page 1 of 1
attiny13 rs232
Posted: Sun Jun 10, 2012 4:10 pm
by simisv
hi
i am using rs232 on attiny13 , 9.6mhz , 3Volt , and is not working .
i dont now how to solve the problem.
thank you
Re: attiny13 rs232
Posted: Mon Jun 11, 2012 9:47 am
by Benj
Hello,
Have you got a LED on your application you can flash at say 1hz to confirm that your Flowcode setup is correct for the hardware? Once you have confirmed delays are ok on the hardware you can be pretty sure that the RS232 baud rate is being calculated correctly.
Re: attiny13 rs232
Posted: Mon Jun 11, 2012 10:00 am
by simisv
hi
thank you for response
i have 3 led's on outputs and all tested with 1sec delay flash and all ok
serial port not working
Re: attiny13 rs232
Posted: Mon Jun 11, 2012 11:05 am
by simisv
now i tested tx send data and i receive strange caracters on pc terminal
tested with diferent baudrate and receive rong data on pc terminal
Re: attiny13 rs232
Posted: Mon Jun 11, 2012 1:12 pm
by simisv
rs232 custom baudrate settings not working
Re: attiny13 rs232
Posted: Tue Jun 12, 2012 10:10 am
by simisv
Hi
No one knows a solution to my problem?
Thank you
Re: attiny13 rs232
Posted: Tue Jun 12, 2012 10:37 am
by Benj
Hello,
My guess is that the baud rate for the software UART is slightly off which is why you are not receiving any data.
There are several posts on the forum regarding tweaking the baud of the software UART connection.
The first thing I would do is probably transmit the byte value 0x55 over the RS232 in a loop and use a scope to check the bit timings of the signal. Is this something you are able to do?
Re: attiny13 rs232
Posted: Tue Jun 12, 2012 10:45 am
by simisv
Hi
I dont have a scope , only multimeter .
Re: attiny13 rs232
Posted: Fri Jun 15, 2012 1:04 pm
by simisv
hi
i found a posible problem on this project
i tested the attiny13 rs232 with external clock 8mhz and is working ok
how can i solve the internal clock problem ???
thank you
Re: attiny13 rs232
Posted: Fri Jun 15, 2012 4:52 pm
by Benj
Hello,
My guess is that the internal clock is off slightly which means your software baud is slightly off.
Have a look at the output C code file from Flowcode and search for this line.
#define %m_SW_BAUD %r
%m will be the component instance eg RS232_1 and%r will be a numeric value.
Then go to the component customisation and edit the defines code function.
Again find the line
#define %m_SW_BAUD %r
and this time replace the %r with the numeric value from the output C code file.
Adjust this number up and down slightly and fingers crossed you will find a value that allows the baud to work correctly on your device.
There may be another way which is to tune the internal oscillator but i'm not 100% how and even if this is possible on the ATTiny devices.
Re: attiny13 rs232
Posted: Sun Jun 17, 2012 12:57 pm
by simisv
hi Benj
thank you for your response
i found the value for rs232 but is ok only with sending data ,
the Rx is not whorking
This value can be different for different attiny13 ?
i will keep the external oscillator , is better for me .
Thank you