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.

DCC communication between commander and decoder

Status
Not open for further replies.

fejesg

New Member
Hello, All!

I would like to make a very simple DCC system (digital modell railway) with 16F716 commander and 16F716 decoder in engine.

I made electronics succesfully, when I apprehended using of booster, and logic of NMRA standard signal (preamble,0, address,0,instruction,0,error,1); but I don't know, how I get sended signals with decoder?

So; the logical 0 means that You change by booster "direction" of rails (change polarity) at first +/-, wait 58 mikrosec (using by 4 MHz xtal oscillator it means 58 steps), change polarity -/+, wait 58 mikrosec again, and sign is ready. Logical 1 is same, but the waiting time is 100 mikrosec.

I tryed to simulate a signal-sending-routine: made a transmitter PIC and a receiver PIC. Both are same, difference is only that transmitter gives a logical 0 sign, receiver gets it.

I made a short bit-examination (receiver input is RB4):
btfss PORTB,4
goto $-1
wait_40mks
btfss PORTB,4
goto $-1
bsf PORTB,7 (connected LED)

I thought that if I sent a 58 mikrosec long sign (simulated BSF), if the 40 mks delay expired, the input sign 1 yet, that the second bit-trap enables to pass-on. If I put into routine a 100 mikrosec long delay, when it stops, the input sign must be ZERO (it expired before 42 mikrosecs...), the second bit trap must makes a never-ending cycle - BUT NOT !!!!!!!!!! NOT MAKES! WHY??????????????????????????????????

Please help me. What is the problem? What I corrupt? Please help me, If I shall understand it, I shall can make routines for my DCC system.

ThanX forwardly all helps!

fejesg:confused:
 
Hi, Bill!

Thank You the fast reply. So, the asm progs are a bit long... May I send it by attached file? And which format can You check the schematics? Is it enough to attach sch-s&brd-s (by Eagle 5.0.3 freeware), or should I export to png? How is better for You?

fejesg
 
Hi, Bill!

Thank You the fast reply. So, the asm progs are a bit long... May I send it by attached file? And which format can You check the schematics? Is it enough to attach sch-s&brd-s (by Eagle 5.0.3 freeware), or should I export to png? How is better for You?

fejesg

hi,
Attach the program as *.asm and the circuit as *.png:)
 
Hi Eric!

Yes, I attach the last version of commander&decoder (I tryed to make circuits with 16F84A, 16F628A and 12F683 - but I stayed with 16F716; because 84A has no extras and needs xtal osc, 628A has many extras (pwm, tx), has intosc_4mhz but has not ADC-s, 683 has pwm, ADC-s, intosc_4mhz, but has only 5 I/O pins, whisc is not enough to handle LCD and DCC ports.... so, if I shall understand progamming devices, I shall make switch-signal-accessory decoder by 12F683)

The attached circuits are working, because I made them on probe-panel.

fejesg :eek:
 

Attachments

  • 16f716 commander.png
    16f716 commander.png
    24.7 KB · Views: 576
  • 16f716 decoder.png
    16f716 decoder.png
    20.1 KB · Views: 594
  • test_transmitter.asm
    1.9 KB · Views: 213
  • test_receiver.asm
    1.8 KB · Views: 202
  • 716_dcc_boos_vB1.asm
    31.4 KB · Views: 214
So; because of I shall to make a very simply electronic (for myself, not want to resell), I thought out 2 own varibles, which are in NMRA standard, by free using by amateurs; CV105 and CV106.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top