RS 232 Bit Banging PIC to PIC

Forum for problems or queries regarding Flowcode Comms Components. Eg LIN, I2C, SPI, RS232, CAN, IrDA etc

Moderators: Benj, Mods

Post Reply
KrisJeff
Flowcode v5 User
Posts: 25
Joined: Sun Feb 01, 2009 5:32 pm
Location: Albox, Almeria, Spain.
Has thanked: 4 times
Contact:

RS 232 Bit Banging PIC to PIC

Post by KrisJeff »

Downloaded Bit Banging RS232 Data out and Data in from the Matrix examples site.
Slightly changed Data out to suit 8 bits input. This seems to work spot on as with one start bit (0) 8 data bits and one stop bit (1).
Had my scope on this and seems perfect. Timing also looks correct.

The problems are Data in. If I input up to 3 in data out then data out gives a running light effect on the eight outpur bits.
More than 3 I get a a steady output that will repeat, however it's nothing like the input in data out.

For instance if I have bcd serial code of 7 out of data out PIC I get 41 out of the data in PIC. For a bcd in of say 15 I get out 205.
This is fully repeatable ? If I input say 7 then I expect 7 out.
Although I have slightly altered data out PIC from the examples (to facilitate 8 input bits and with different PIC 16F873) this seems to work perfectly according to my scope.
However I've not changed the Data In PIC (only chip to 16F873). This is exactly as the examples from the Matrix page? The baud rate seems correct from data out and both clock speeds are 19660800.
I'm fully reliant on the macro's provided and if I'm honest I don't fully understand these as I can't look into them. As stated the data out works straight out of the box as it were but the data in (BCD out) I just can't get to work.
I've no idea regarding C code or similar I've always managed to date with Flowcode. I trying to understand serial comms and I'm very near. To me this seems some sort of timing issue. Can anyone at Matrix put me straight?

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:

Re: RS 232 Bit Banging PIC to PIC

Post by Benj »

Hello

I dont understand when you say you altered the example to allow for 8 data bits. The examples are already suited towards 8 data bits. Please can you try redownloading the files from fresh and seeing if they work ok as is. Changing the PICmicro device should be fine as long as both devices are using the same crystal speed and both chip clock speeds and configurations are setup correctly.

Post Reply