Questions about serial data transmission using the cog video hardware.
blackmesa82
Posts: 4
I am attempting to use the cog video hardware in 2-color VGA mode to serialize a 10-bit data packet for RS-232 transmission. The program is coded in Spin. When I initially setup the VCFG and the VSCL, before the first waitvid instruction, the output pin that is selected is either high or low. This initial state appears to be completely random after a processor reset.
Is there a way to set the initial output pin state before the first waitvid instruction? For RS-232 transmissions, I need this pin to be high by default.
Whatever the initial state of the output ends up being, it will always revert to that state between subsequent waitvid commands. It does not hold the last bit in the "pixel" stream. So if the output pin happens to start up high, it will always be high between transmissions. I am sending one character at a time, so the video serializer runs out of data after each 10 bit packet. Is there a way to set the pin state between waitvid instructions?
As a less important question, is there a way to clear the pixel and color data in the video hardware before or during the video configuration and setting up the PLLA? Sometimes after a reset, the serializer will send out a few bits of random data before any waitvid instruction is encountered.
Thanks for your help in advance.
- eeo
Is there a way to set the initial output pin state before the first waitvid instruction? For RS-232 transmissions, I need this pin to be high by default.
Whatever the initial state of the output ends up being, it will always revert to that state between subsequent waitvid commands. It does not hold the last bit in the "pixel" stream. So if the output pin happens to start up high, it will always be high between transmissions. I am sending one character at a time, so the video serializer runs out of data after each 10 bit packet. Is there a way to set the pin state between waitvid instructions?
As a less important question, is there a way to clear the pixel and color data in the video hardware before or during the video configuration and setting up the PLLA? Sometimes after a reset, the serializer will send out a few bits of random data before any waitvid instruction is encountered.
Thanks for your help in advance.
- eeo
Comments
First, the video hardware needs to be run continously. That is you must constantly feed it with data to keep the lines held right. Now, you can just set the pin state I belive first before enabling the video hardware and maybe that will work.
...
Try setting the pin high first. Setting up the video hardware. Then sending all your packets to be transmited. Then change the video config so that it has no pins to output on. That way it should not conflict.
Alos, note that you will not be able to transmit at low speeds without data trickery usign the video generator.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Nyamekye,
I found a solution to the default pin state problem. I simply padded the waitvid with ones on entry and exit and remove the forced high just before sending a packet and immediately reapply it afterwards.
The following Spin code works from 110 baud to 115,200 (I can't test it any higher):
Thanks again.
- eeo