Forum Discussion
Altera_Forum
Honored Contributor
16 years agoFVM, take a look and give your opinion,do you feel I am getting closer???
Trust me, I appreciate your help, I am having a blast learning this stuff // running under posedge 27mhz clock on Terasic DE1 // working now with venus Venus634LPx unit // info at http://www.sparkfun.com/commerce/product_info.php?products_id=9133 // coperniucs unit quit, reason unknown // buad rate is now 9600 // when we are not in a byte (uartf=0) and GPSIN goes low if (uartf==0 & GPSIN==0) begin uartf<=1; bitstreamin<=0; bitcount<=0; bitqueu<=bitqueu << 8; // shifting queu left 8 bits to make space for new byte end if (uartf==1) begin if (bittimer!=2812) bittimer<=bittimer+1; if (bittimer==2812) begin bitstreamin[10]<=bitstreamin[9]; bitstreamin[9]<=bitstreamin[8]; bitstreamin[8]<=bitstreamin[7]; bitstreamin[7]<=bitstreamin[6]; bitstreamin[6]<=bitstreamin[5]; bitstreamin[5]<=bitstreamin[4]; bitstreamin[4]<=bitstreamin[3]; bitstreamin[3]<=bitstreamin[2]; bitstreamin[2]<=bitstreamin[1]; bitstreamin[1]<=bitstreamin[0]; bitstreamin[0]<=GPSIN; bittimer<=0; bitcount<=bitcount+1; end // when bitcount gets to 10 we add it onto the que // bit order reversed because UART gives us LSB first, MSB last if (bitcount==10) begin uartf<=0; bitcount<=0; bitqueu[0]<=bitstreamin[9]; bitqueu[1]<=bitstreamin[8]; bitqueu[2]<=bitstreamin[7]; bitqueu[3]<=bitstreamin[6]; bitqueu[4]<=bitstreamin[5]; bitqueu[5]<=bitstreamin[4]; bitqueu[6]<=bitstreamin[3]; bitqueu[7]<=bitstreamin[2]; end end