Klen
Member level 1
Hello everyone
I am relatively new to the engineering field and have virtually no prior practical experience nor knowledge. Hence, please bear with me if my question seems too trivial or makes little sense.
I have been asked to generate a Pulse per second (PPS) signal from an FTDI FT2232H Mini Module. The programming has to be done in Visual Basic (C++ or C#).
One probable solution which I think could work is something like:
****************************************
FTDI Clock = 30 Mhz = 3,000,000 cycles per second
If Baud = 100, => 10 ms = 300,000 cycles.
Default Value: PPS = 0; counter = 1;
if rising_edge (FTDI_CLK)
if (counter > x) /* x can be changed for a different duty cyle. For eg: x = 3 will give a rise time of 30 ms to the PPS. */
PPS = 0;
if counter == 300,000
counter = 1;
PPS = 1;
else
counter++;
*******************************************
Unless I have gotten the whole concept wrong, the above code should be logically correct. But even then, I am at a loss as to how to detect the rising edge of the FTDI clock (which again I am only assuming has a clock of 30MHz).
I am not looking for a complete solution but a nudge towars the positive direction would be very highly appreciated.
(Also, I apologise if the question does not belong in this forum. Please let me know and I will move it immediately)
Best Regards and Thanks in advance
Klen
I am relatively new to the engineering field and have virtually no prior practical experience nor knowledge. Hence, please bear with me if my question seems too trivial or makes little sense.
I have been asked to generate a Pulse per second (PPS) signal from an FTDI FT2232H Mini Module. The programming has to be done in Visual Basic (C++ or C#).
One probable solution which I think could work is something like:
****************************************
FTDI Clock = 30 Mhz = 3,000,000 cycles per second
If Baud = 100, => 10 ms = 300,000 cycles.
Default Value: PPS = 0; counter = 1;
if rising_edge (FTDI_CLK)
if (counter > x) /* x can be changed for a different duty cyle. For eg: x = 3 will give a rise time of 30 ms to the PPS. */
PPS = 0;
if counter == 300,000
counter = 1;
PPS = 1;
else
counter++;
*******************************************
Unless I have gotten the whole concept wrong, the above code should be logically correct. But even then, I am at a loss as to how to detect the rising edge of the FTDI clock (which again I am only assuming has a clock of 30MHz).
I am not looking for a complete solution but a nudge towars the positive direction would be very highly appreciated.
(Also, I apologise if the question does not belong in this forum. Please let me know and I will move it immediately)
Best Regards and Thanks in advance
Klen
Last edited: