Page 5 of 8
Posted: 06.03.2013, 20:40
Just to be sure,
Liviu M wrote:
- move the LN_OUT connection from pin 22 (RB0)
pin 22 is RB1 not RB0 right?
I have the transistors already in place. I then just need to move the connection from pin 7 of lm311 from pin 21 of the pic to pin 18 and the one side of the 4k7 resistor from pin 22 of the pic to pin 17?
Posted: 06.03.2013, 21:06
I have to correct myself, the GCA172 I have here resembles the schematic from scan.zip on page 3 of this topic, but has an additional transistor between led2 and pin 23 of the pic. Pin 22 of the pic goes via a 4k7 to the base of transistor T1, the collector (or emitter, I always mix these up) is connected to gnd and the emitter (or collector) via a 68 ohm resistor is connected to pin3 of the db9 loconet connector. Can I just move the connection from pin 22 of the pic to pin 17 or do I need to build the complete transistor network?
Posted: 06.03.2013, 22:04
unfortunately the schematic you have is a little bit harder to be modified (i forgot about this one, I was remembering me just the first one).
You should obtain the transistors+resistors group as in the schematic on the first page.
The good news is, for the attached version you can spare the cuts on PCB.
Btw, the emitter is the terminal with arrow.
Later edit: yes, pin 22 is RB1.
@all interested: attached is a (hopefully) functional version of hard-usart interface. If someone tests it and has comments, please share them.
PS I think I should start to give some version numbers to the firmwares.
Posted: 07.03.2013, 15:09
Hi Liviu, Peter,
I can find the different schematics, but am unable to find a listing with values/types of the components, making it a bit difficult to add components.
From what I understand of electronics, when the pin of the pic connected to R14 (left schematic) or R7 (right schematic) goes high, the result is the same for both schematics, T1 conducts and the Loconet dataline is pulled to ground. So my question is do I really need to add R12, R14 and T2 (and why)?
Posted: 07.03.2013, 15:59
the two schematics are not equivalent, but the Loconet out signal (collector of the T1) is inverted in the two cases (the left schematic has an inverting stage more than the right one).
For the left schematic, the T2 is a pnp transistor. It conducts when its basis potential is lower than its emitter (its emitter is connected to the positive supply), and blocked when its basis has the emitter potential. That means, when the PIC puts a 1 on the output pin, the T2 will be blocked, when PIC puts a 0, the T2 conducts. When T2 conducts, it puts the VCC voltage found on its emitter terminal to its collector terminal. That means, a 0 on PIC output bring a 1 at the T2's collector - first inverting stage.
The T1 transistor functions in the same way for both schematics. It is a npn transistor. It conducts when its basis potential is higher than its emitter. When it conducts, it puts its emitter potential (GND) to its collector. So, when it conducts, it gives a logical 0 to the Loconet output.
Combining the T1 & T2 for the left schematic:
- when the PIC puts a 0 on the output pin, the T2 puts a 1 on the T1 bases and T1 puts a 0 on the Loconet
- when the PIC puts a 1, T2 is blocked, and the R12 pull the basis of the T1 to 0, blocking it & leaving the Loconet idle potential (Loconet 1).
==> PIC's output pin and the Loconet have the same logical level
With only the T1:
- when the PIC puts a 0 on the output pin, T1 is blocked and the Loconet has the idle potential (loconet 1);
- when the PIC puts a 1, T1 is conducting and puts a 0 on the Loconet.
==> PIC output & Loconet have inverted logical levels.
I hope I wasn't to confuse.
Posted: 07.03.2013, 16:10
Thanks for the clear explanation. Now I just need the values for R12 and R14 (assuming R7 and R10 remain unchanged). Can I use a BC557B (part of my basic stock of electronics) for T2?
Posted: 07.03.2013, 17:12
BC557 is OK. For the resistors I'll try with 4,7 kOhm for the R14 & 10 kOhm for the R12, but I'll also change the R7 with a 10 kOhm one.
However, since I'm not very good to analog designs,
maybe is better if you wait for Peter's opinion.
Posted: 07.03.2013, 19:30
I've done some more tests and now I'm sure the RC7 (Rx) pin's state can be read even if the USART port is active. That means, I've done a little bit better implementation of the CD_BACKOFF_TIME test.
The resulting firmware is in the attachment.
Posted: 08.03.2013, 19:32
I am sorry that I did answer sooner.
But just to night I produced the new board and will assemble it maybe to-morrow, but surely Sunday.
Then I will let you know how it worked out.
Posted: 08.03.2013, 20:01
As you told me some time ago
, it's a hobby, so no hurry.
Edit: just an info - I've done some tests with 18F14K50 (I like it, is quite small, quite cheap and powerful, I plan to use it in other project) and it works well as ln2usb interface.
Posted: 08.03.2013, 20:14
Pc-board is already containing some parts.
It remains hobby, be sure of that, but I am just curious.
I still can switch to 14K50 chip, I like that not only for size but also price.
I have those in stock too.
But first let me try this one.
Posted: 08.03.2013, 20:36
I'm also curious how it works this time.
since I'm supposed to support the hard-usart version
, I've just made on my board *) the same changes you try to do. With the changes & values I've said in the previous posts (no cuts) it is just working for me.
*) Till now I've used the soft-usart version (first design, to lazy to modify it as long as it was working). The hard-usart version I've tested on the bread-board only.
Posted: 09.03.2013, 12:19
I have board made up.
With Rocrail I sometimes can get the query from any GC50 connected to GCA172. But I can not read the contents, no answer.
It seems to hold when I try to do that, and have to reset Locobuffer.
All commands going out and sensors coming in work fine.
Very promising so far!
I have to leave now, so work stops or this moment.
Maybe to-night, definately to-morrow to be continued.......
Posted: 09.03.2013, 20:04
As far as it looks like now, there is a lot of LocoNet communication missing in GCA72.
Rocrail is running with GCA172 as LocoBuffer setting 57600 LocoBuffer no CTS.
Here is an update of what I have established:
Feed-backs from GCA50 into LocoNet are visible on IB screen, but not in Rocrail. Sometimes they work.
Led2 shows activity on LocoNet.
In Rocrail I can switch a turnout, and the switch is reacting.
Power on/off works from Rocrail to IB, but switching power ON/OFF on IB is not visible in Rocrail.
In programming, I can query a GCA50, but not read the settings of it. When I do that, total communication is blocked and Rocrail needs restart.
I have to disable CTS in Rocrail, otherwise nothing works.
Mainly, it looks like communication OUT from Rocrail works fine but a lot of input is missing. Not all though.!
Then I tried to use ULNI setting (in stead of LocoBuffer) but the result is fairly the same.
Posted: 09.03.2013, 21:20
I've had no time to made more tests, so I can't say nothing yet, but your Rocrail setting is not the best one.
Because of the echo, in Rocrail you should use not Locobuffer, but the ULNI. In my setup it is working better in this way (57600&115200 baud), but I also should more tests.
I hope this will helps a bit.