View previous topic :: View next topic |
Author |
Message |
musti463
Joined: 19 Sep 2013 Posts: 66
|
|
Posted: Sun Aug 24, 2014 11:10 am |
|
|
thank you i fix it _________________ M.Emir SADE |
|
|
musti463
Joined: 19 Sep 2013 Posts: 66
|
|
Posted: Sun Aug 24, 2014 1:19 pm |
|
|
When i use following codes. System working corretly.
MASTER:
Code: | char data[9]="12345678";
|
SLAVE:
But !!! When i use following codes. System working but i see errors. I don't know Is there a limit for sending data length?
MASTER:
Code: | char data[64]="mustafaemirsade-mersin-463-1925-1905-galatasaray";
|
SLAVE:
You can see sorting is wrong. And data[10]-data[25] is empty. Why?
ERRORS:
_________________ M.Emir SADE |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19215
|
|
Posted: Sun Aug 24, 2014 1:59 pm |
|
|
Look at my original reply.
Look at items 1, and 3.
Realise if these are _not_ done, the receiver, can/will receive garbage, or NULL characters (your \0), when the bus is not driven.... |
|
|
musti463
Joined: 19 Sep 2013 Posts: 66
|
|
Posted: Sun Aug 24, 2014 2:42 pm |
|
|
@Ttelmah
can you give me schematics and values? _________________ M.Emir SADE |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9097 Location: Greensville,Ontario
|
|
Posted: Sun Aug 24, 2014 3:26 pm |
|
|
sorting ???? I don't see anything in your code that 'sorts' !
Also as MR. T points out you MUST get the RS485 tranceivers properly configured.Consult the datasheet or Google, there are even BOOKS written about the subject !
If you ONLY have one master and one slave you do not need RS485, rather RS232( using a MAX232 chip) will work without any problems.Simple wire them up and you're done. If PICs are on the same bench ,ONE MAX232 will work for both PICs making the wiring even easier.
The other detail is. Is all done under Proteus/ISIS and not real hardware ???
That question needs to be answered fast.
hth
jay |
|
|
musti463
Joined: 19 Sep 2013 Posts: 66
|
|
Posted: Sun Aug 24, 2014 5:19 pm |
|
|
Firstly proteus hardware and later real hardware _________________ M.Emir SADE |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9097 Location: Greensville,Ontario
|
|
Posted: Sun Aug 24, 2014 6:10 pm |
|
|
hmm.. Proteus.... Please acknowledge that it is FULL of bugs, errors and faulty DRCs. It is NOT reliable as a 'simulator'. In fact, EVERY 'schematic' presented here will NEVER work in the real world.
Please look at any RS485 transceiver datasheet and reconfigure your 'project' As others have said, your 'schematic' is not correct.
recode/recompile/retest/report back
jay |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Aug 24, 2014 6:39 pm |
|
|
Post your latest schematic so they can review it. |
|
|
musti463
Joined: 19 Sep 2013 Posts: 66
|
|
Posted: Mon Aug 25, 2014 5:46 am |
|
|
I found only these schematics:
and my last shematic:
@temtronic i am learning RS485 communication now. i can't use rs232 because i will use 1 master 5 slave, when i learn rs485 communication tottally _________________ M.Emir SADE
Last edited by musti463 on Mon Aug 25, 2014 8:06 am; edited 1 time in total |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1630 Location: Perth, Australia
|
|
Posted: Mon Aug 25, 2014 7:18 am |
|
|
Look at the figure 9 you posted. See that 'A' on the 485 of the transceiver goes to a pull-up resistor on the safe-bias configuration. Your schematic has A going to a pulled down instead.
However - be aware that some vendors label the inverting input as A and others label the non inverting input as A. They are electrically pin-for-pin compatible but use A and B nomenclature differently. You need to ensure the specific 485 transceiver you are using is the same as the one in the application note to ensure your A and the applications A both refer the the same input. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
musti463
Joined: 19 Sep 2013 Posts: 66
|
|
Posted: Mon Aug 25, 2014 8:07 am |
|
|
asmallri wrote: | Look at the figure 9 you posted. See that 'A' on the 485 of the transceiver goes to a pull-up resistor on the safe-bias configuration. Your schematic has A going to a pulled down instead.
However - be aware that some vendors label the inverting input as A and others label the non inverting input as A. They are electrically pin-for-pin compatible but use A and B nomenclature differently. You need to ensure the specific 485 transceiver you are using is the same as the one in the application note to ensure your A and the applications A both refer the the same input. |
i made a mistake i changed _________________ M.Emir SADE |
|
|
musti463
Joined: 19 Sep 2013 Posts: 66
|
|
Posted: Mon Aug 25, 2014 9:42 am |
|
|
Can we send directly float values? else we have to use sprintf for float to string and send data by rs485 ? _________________ M.Emir SADE |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19215
|
|
Posted: Mon Aug 25, 2014 10:59 am |
|
|
You can send the bytes that comprise float values, and then re-assemble these at the other end.
Easiest way is a union.
This is fine PIC-PIC, but will give difficulties PIC-PC, since the PIC internally stores the values in a different format to the PC. There are routines in the supplied examples that include the conversion (search for IEEE). |
|
|
musti463
Joined: 19 Sep 2013 Posts: 66
|
|
Posted: Mon Aug 25, 2014 12:46 pm |
|
|
@Ttelmah can you give me some example codes about it _________________ M.Emir SADE |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
|