View previous topic :: View next topic |
Author |
Message |
vortexe9000
Joined: 07 Jun 2010 Posts: 50 Location: Banned - spammer
|
munication |
Posted: Tue Nov 29, 2011 1:28 pm |
|
|
fgh _________________ Banned for spamming his own posts
Last edited by vortexe9000 on Sun Feb 19, 2012 7:45 am; edited 2 times in total |
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9243 Location: Greensville,Ontario
|
|
Posted: Tue Nov 29, 2011 1:55 pm |
|
|
Couple of items.
Schematic does NOT show resistors for the LEDs. You should have say 470r - 1k to limit current.
You can join re_ and de on the MAX487s to save a pin as well as have 'better' code(easier).
12k pullup/pulldown resistors for the 485 bus seem high, I think they should be 1k2 not 12k.
MAX487 A should be tied to the other MAX487 A(pin 6 to 6
MAX487 B "" MAX487B (pin 7 to 7)
You show that they are a<--->b(6 to 7), b<--->a(7 to 6) !
Please confirm hardware is setup right..then the software should work.... |
|
|
vortexe9000
Joined: 07 Jun 2010 Posts: 50 Location: Banned - spammer
|
THANKS |
Posted: Wed Nov 30, 2011 12:16 am |
|
|
dddd _________________ Banned for spamming his own posts
Last edited by vortexe9000 on Sun Feb 19, 2012 7:23 am; edited 1 time in total |
|
|
RF_Developer
Joined: 07 Feb 2011 Posts: 839
|
|
Posted: Wed Nov 30, 2011 2:43 am |
|
|
You have this define:
#define RS485_USE_EXT_INT TRUE
This forces the RS485.c to use software uarts and external interrupts rather than the hardware and rda interrupt.
You also have your own rda isr which buffers data, but then you don't do anything with that data. That doesn't matter as with RS485_USE_EXT_INT == TRUE the interrupt will never happen.
So, remove #define RS485_USE_EXT_INT TRUE - its defined FALSE by default by rs485.c - and delete your rda interrupt routine completely. Let rs485.c handle the interrupts and buffering. It will; I've used it successfully before (as a stepping stone while working up a MODBUS project). Do all the hardware things suggested by Temtronic, and remember A goes to A, B goes to B.
RF Developer |
|
|
|