Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

synchronization problem

Status
Not open for further replies.

jijita

New Member
i'm sending data serially from pic 16f84 to 16f877 and then displaying it on leds
the data is encoded
the data ain't arriving to the leds
i used a push button for the first bit sent it just worked for the first
i have a problem of synchronisation that i tried to solve uselessly
any idea
 
jijita said:
i'm sending data serially from pic 16f84 to 16f877 and then displaying it on leds
the data is encoded
the data ain't arriving to the leds
i used a push button for the first bit sent it just worked for the first
i have a problem of synchronisation that i tried to solve uselessly
any idea

Consult my RS232 tutorials, it's very simple to do RS232 between two PIC's.
 
can you please be more precise

please just give me a summary
or a hint on how to start and what i should do basically
it's very important to me
i've been trying without using rs232 to make the code work but in vain
i tried to make the first pic 16f84 wait until the second is ready to receive from it but it worked for the start bits only
 
Re: can you please be more precise

jijita said:
please just give me a summary
or a hint on how to start and what i should do basically
it's very important to me
i've been trying without using rs232 to make the code work but in vain
i tried to make the first pic 16f84 wait until the second is ready to receive from it but it worked for the start bits only

Read the tutorial - it explains everything you need to know, including how it works, and gives proven tested code examples.
 
i want to use only one wire to connect a port of the first pic to the port of the second
i'm doing this to make it wireless later
does that apply to rs232 or i 'm obligated to use connectors
 
i forgot to tell you that i don't want to use a stop bit
i only use a start code (composed of many bits)
i want to test it first on one byte
then on several bytes
 
jijita said:
i want to use only one wire to connect a port of the first pic to the port of the second
i'm doing this to make it wireless later
does that apply to rs232 or i 'm obligated to use connectors

RS232 does only use one wire (for one way), plus the ground wire of course. You can simply connect two PIC's together with out using a MAX232, just join the grounds and connect the TX pin to the RX pin.

For your other point, no stop bit, this makes life rather more complicated, a stop bit is extremely important the way RS232 works - even if you don't bother reading it, which my tutorial code doesn't.

Your mention of wanting to make it wireless later gives the reason, you really need a different system than RS232 for a radio link. I suggest you try searching for "manchester coding", which is a commonly used radio protocol - but be warned, it's a great deal more complicated than RS232, and a lot slower.

If speed isn't important, the Sony SIRC code in my IR tutorial could be adapted for a radio link quite easily.
 
if i'm sure that the code i'm using is synchronising well
could the problem be wire related
i'm using a regular wire i think it's called telephone wire you know the one used when connecting for ex a led to a pin or resistance or whatever
can this wire be causing data loss and if it's true what kind of wire i should use
 
jijita said:
if i'm sure that the code i'm using is synchronising well
could the problem be wire related
i'm using a regular wire i think it's called telephone wire you know the one used when connecting for ex a led to a pin or resistance or whatever
can this wire be causing data loss and if it's true what kind of wire i should use

How long is your wire?, if it's a huge length you could try checking the far end with a scope (if you have access to one).

You could also try using my RS232 code, and see if that works down your wire - that would prove if the fault lies in your code, or in your hardware somewhere (including the wire).
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top