Serial RS232 signal to parallel...

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 2 and 3.

Moderators: Benj, Mods

Post Reply
de fre
Posts: 7
Joined: Tue Nov 21, 2006 10:03 am

Serial RS232 signal to parallel...

Post by de fre »

I want to recive a rs232 signal with my UART into my pic and send it back parallel out...
So I want to send a parallel signal out of a rs232 serial signal.
So I need to put every bit of the rs232 8bit signal on to an other output of port B...
I only got flowcode v2 and I know a little bit of c-code;
So I tryed this:
http://img340.imageshack.us/img340/6727 ... lelok7.jpg
this is the code I putted in the code object...

Code: Select all

char SIGNALOUT[8];
char SOUTB[8]
SOUTBbits.RB0 = SIGNALOUTbits.RB0
SOUTBbits.RB1 = SIGNALOUTbits.RB1
SOUTBbits.RB2 = SIGNALOUTbits.RB2
SOUTBbits.RB3 = SIGNALOUTbits.RB3
SOUTBbits.RB4 = SIGNALOUTbits.RB4
SOUTBbits.RB5 = SIGNALOUTbits.RB5
SOUTBbits.RB6 = SIGNALOUTbits.RB6
SOUTBbits.RB7 = SIGNALOUTbits.RB7

char PORTB[8];

PORTBbits.RB0 = SOUTBbits.RB0
PORTBbits.RB1 = SOUTBbits.RB1
PORTBbits.RB2 = SOUTBbits.RB2
PORTBbits.RB3 = SOUTBbits.RB3
PORTBbits.RB4 = SOUTBbits.RB4
PORTBbits.RB5 = SOUTBbits.RB5
PORTBbits.RB6 = SOUTBbits.RB6
PORTBbits.RB7 = SOUTBbits.RB7

I think that the code is right but when I try to compile he gives an error...

So can some 1 pls help me, I don't know what else to do....
thx, FrΓ©


edit:
I use a pic16f877 and no wotchdog timer or parety bits, just the easy way...

User avatar
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:

Post by Benj »

Hello

I have created a program to do this.

What you need to do is something similar to the following. First you must create a byte variable in flowcode named RETVAL.

Code: Select all

Loop while 1
{
     RETVAL = Receive RS232 timeout of 100
     Output PortB RETVAL
}

de fre
Posts: 7
Joined: Tue Nov 21, 2006 10:03 am

Post by de fre »

Benj wrote:Hello

I have created a program to do this.

What you need to do is something similar to the following. First you must create a byte variable in flowcode named RETVAL.

Code: Select all

Loop while 1
{
     RETVAL = Receive RS232 timeout of 100
     Output PortB RETVAL
}
I just need to put this in the c code object so the other objects in my code may stay there?
(here is my object code:)
http://img340.imageshack.us/img340/6727 ... lelok7.jpg


really thx


edit:
I tryed it.
when I try to compile he gives an error...
same problem as before...

you made your pragram also in flowcode?
can you mabe send your program pls?

User avatar
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:

Post by Benj »

All you have to do is replace your C code block with an Output Block which writes the value in RETVAL to portb.

If you wish to use the C cde icon then you can do something similar to this.

portb = FCV_RETVAL;

This will assign the value in the Flowcode variable RETVAL to portb

de fre
Posts: 7
Joined: Tue Nov 21, 2006 10:03 am

Post by de fre »

Benj wrote:All you have to do is replace your C code block with an Output Block which writes the value in RETVAL to portb.

If you wish to use the C cde icon then you can do something similar to this.

portb = FCV_RETVAL;

This will assign the value in the Flowcode variable RETVAL to portb
as far I can see now with 4 leds on the portB it works...
really wierd I'm sure It didn't word a few munths ago...
but now it works so thx

really thx, FrΓ©

Post Reply