Hello at All,
iΒ΄ve problems to cumunicate between an ATmega16 and my PC.
So IΒ΄m searching for an exampel of the RS-232 comunication, witch is programmed in AVR.
Becaus IΒ΄ve the original AVR-version of Flowcode, I canΒ΄t open the Pic versions.
Thanks for helping
best regards
Jan
RS-232 AVR exampels
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: RS-232 AVR exampels
Hello
Flowcode is already compatible with RS485.
RS485 is basically just a name for the voltage shifting and manipulation that is done to the serial bus. RS232 is acheived by attaching our RS232 E-Block or a MAX232 chip to the hardware UART pins of the chip to shift the voltages from GND and 5V to +12V and -12V. Similarily RS485 can be acheived by attaching a MAX485 to the pins of the UART.
The max chip is only half duplex so you will have to use some digital I/O pins to control the data direction. I am also told that full duplex RS485 chips are available so if you are using these then you will not have to do this.
In RS485 the 9th data bit can be enabled to allow the receiver to determine the difference between data and addresses. The current RS232 component in Flowcode will not let you do this but you should be able to edit the component driver code to allow this functionality.
Hope this helps.
Flowcode is already compatible with RS485.
RS485 is basically just a name for the voltage shifting and manipulation that is done to the serial bus. RS232 is acheived by attaching our RS232 E-Block or a MAX232 chip to the hardware UART pins of the chip to shift the voltages from GND and 5V to +12V and -12V. Similarily RS485 can be acheived by attaching a MAX485 to the pins of the UART.
The max chip is only half duplex so you will have to use some digital I/O pins to control the data direction. I am also told that full duplex RS485 chips are available so if you are using these then you will not have to do this.
In RS485 the 9th data bit can be enabled to allow the receiver to determine the difference between data and addresses. The current RS232 component in Flowcode will not let you do this but you should be able to edit the component driver code to allow this functionality.
Hope this helps.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Re: RS-232 AVR exampels
Hello, itΒ΄s me again
I'am writig a Programm to communicate with the PC via RS232, but in my programm is allready a bug.
IΒ΄ve tryed a lot, but I canΒ΄t clear these faults out of my programm.
So I would like to try it here, if some of you experts can help me.
You can find the flowchart in the attachment.
Here a short description of the programm:
I'am useing a ATmega 16 ΒµC
The Pins PA0 and PA1 should have the function of a ADC (10Bit)
The ΒµC should give these values per RS232 to the PC.
The PC sends an value, witch the ΒµC converts to a 16Bit signal. After that, the ΒµC gives the 16Bit out at the Ports B (high Bits) and C (low Bits). On these Ports is a 16Bit DAC connected.
The whole shematic has a function of a closed-loop control.
I hope, that someone can halp me.
Thank you

I'am writig a Programm to communicate with the PC via RS232, but in my programm is allready a bug.
IΒ΄ve tryed a lot, but I canΒ΄t clear these faults out of my programm.
So I would like to try it here, if some of you experts can help me.
You can find the flowchart in the attachment.
Here a short description of the programm:
I'am useing a ATmega 16 ΒµC
The Pins PA0 and PA1 should have the function of a ADC (10Bit)
The ΒµC should give these values per RS232 to the PC.
The PC sends an value, witch the ΒµC converts to a 16Bit signal. After that, the ΒµC gives the 16Bit out at the Ports B (high Bits) and C (low Bits). On these Ports is a 16Bit DAC connected.
The whole shematic has a function of a closed-loop control.
I hope, that someone can halp me.
Thank you
- Attachments
-
- flowchart.fcf_avr
- (5.5 KiB) Downloaded 441 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: RS-232 AVR exampels
Hello
After your RS232 read you will need a decision with the following paremeter.
IN < 255
Then if this decision is true then write the received byte to Port B.
Your current program is overwriting the LEDs with every iteration of the loop and therefore is probably going to fast for you to be able to see the LED values changing.
After your RS232 read you will need a decision with the following paremeter.
IN < 255
Then if this decision is true then write the received byte to Port B.
Your current program is overwriting the LEDs with every iteration of the loop and therefore is probably going to fast for you to be able to see the LED values changing.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel