NTP to DCF pulse

Discussion to talk about software related topics only.
Post Reply
gwijnant
Posts: 3
Joined: Tue Jan 31, 2017 7:14 am

NTP to DCF pulse

Post by gwijnant »

Hi Guys,

We recently purchased a PK70EX-100IR and NTP is working fine. We have some equipment that can only use DCF. The current time equipment we use (phoenix contact), sends a pulse every second.
On the PK70EX-100IR on pin 2 and pin 5 I regularly get some pulses (like morse code :D ). Is there a way to configure these 2 pins to send a pulse every second (like the phoenix contact does). I hope this is clear to you most of you as I have no experience in this field at all...
If anything is unclear, please do not hesitate to ask.

Best Regards,

Guy
User avatar
dciliske
Posts: 623
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: NTP to DCF pulse

Post by dciliske »

Short answer: Yes.

Long answer: I'm not quite sure I understand what you're trying to do. I think you're trying to emulate a DCF receiver. Is this correct?

Also, your description seems to suggest you want to both read and write on the same pins. With your apparent experience, you cannot do that, but that's a much, much longer discussion about communication theory. Is there some reason you cannot use other pins as the outputs?

-Dan
Dan Ciliske
Project Engineer
Netburner, Inc
gwijnant
Posts: 3
Joined: Tue Jan 31, 2017 7:14 am

Re: NTP to DCF pulse

Post by gwijnant »

Hi Dan,

Thank you for the quick response!
Indeed we want to emulate the DCF77 reciever as our equipment only knows this protocol.

I connected a serial cable to the serial port of the PK70EX and saw the pulse (morse code) on pin 2 and pin 5.
For me it does not matter on which 2 pins the output is going to be. The interface is not a serial port but only a connector for 2 wires (DCF+ and DCF-).
Whats the best way to proceed to get this working?

Best regards,

Guy
User avatar
dciliske
Posts: 623
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: NTP to DCF pulse

Post by dciliske »

Ok, something doesn't make sense here. Your combination of part number and pins must be incorrect. The datasheet for the PK70EX-100IR show's pin 2 as GND. Perhaps you're referring to the PK70 with the Multi I/O board or the Digital I/O Board?

Can you give me a block diagram or describe in closer detail what pins of what devices are connected? What do you have that's toggling pins? What connectors on what devices exist? Are you discussing a current implementation and a proposed change? Are you discussing what you need the new one to do but not something that currently exists?

-Dan
Dan Ciliske
Project Engineer
Netburner, Inc
User avatar
TomNB
Posts: 541
Joined: Tue May 10, 2016 8:22 am

Re: NTP to DCF pulse

Post by TomNB »

Hello Guy,

We're used to dealing with developers, and had the impression you were referring to the 40-pin internal connector of the device. Looking at all the posts, we're now wondering if you are referring to the DB9 serial port connector on the front of the unit. Can you confirm exactly what you are connected to? If the DB9, then what you are seeing is ASCII serial data coming out what we refer to as the console port.
gwijnant
Posts: 3
Joined: Tue Jan 31, 2017 7:14 am

Re: NTP to DCF pulse

Post by gwijnant »

Hi Tom & Dan,

I am not a developer at all. I am indeed talking about the DB9 serial port.
So we basicly wanted to know if the console port can be used to transmit DCF77 signal.
Since our equipment needs to have the Signal on 24V we need to add a BC557B Transistor.
I have added a picture of what the total set-up would apparently be.
The RS232 port is on the PK70EX-100IR and the VRI is the equipment that needs to receive the DCF77 signal on 24V.

Best Regards,

Guy
Attachments
DCF.jpg
DCF.jpg (26.54 KiB) Viewed 3761 times
User avatar
dciliske
Posts: 623
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: NTP to DCF pulse

Post by dciliske »

You do know that the PK70 is designed as a development platform with an internal databus to communicate to an internal custom board, right?

Technically, yes, you can configure the RS232 tx pin for GPIO. You can also use the RTS pin instead, that way you can still have the serial output for debugging.

Also, when you say you're using NTP, is this with the NTP blade board or using the NTP Client capability? Depending on whether you're using the NTP server or client, my commentary to you on toggling the output is slightly different.

First up: if you want to output the DCF signal, first you need to determine what the next second's pulse will be (high or low). Once you have that determined, triggering the edge will be done depending on client vs server mode.

If you're using the NTP server, there's three different paths depending on how accurate of timing you want/what you have the ability to do:
  • Simplest: Create a high priority task (higher than Ethernet) that OSTimeDlys for TICKS_PER_SECOND and then writes the next bit.
  • Medium: add a line at the beginning of the 'pps_isr' of the NTPBladeFactoryApp that sets the output line to the correct value
  • Hardest: modify the DMA Timer settings to trigger a DMA transfer to write to the GPIO register controlling the output line to set the correct output.
Client: Create a high priority task (higher than Ethernet) that OSTimeDlys for TICKS_PER_SECOND and then writes the next bit.

In both cases, latch the time you're sending at the start of the bit sequence.

Also, be aware that the TX/RTS pins can only drive up to 15VDC. I'm more of a firmware dev, so I've never really quite got the hang of biased PNP transistors, but I don't think you'll be able to turn off the PNP in the schematic given. Perhaps a NPN driving the base or just use a buffer/comparator?

-Dan
Dan Ciliske
Project Engineer
Netburner, Inc
Post Reply