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