Simple test that the GPS module is indeed talking and the MCU can indeed hear it. It's dropping characters though, and it's polling based and whatnot, so it will need to change fast. Also, so far, in my office, the GPS hasn't gotten a lock. Is the antenna good enough? How about the antenna match?

This commit is contained in:
Michael Colton 2016-04-21 20:55:56 -06:00
parent a211a0b9dd
commit 59e59d7af1
5 changed files with 90 additions and 46 deletions

14
.gitignore vendored
View file

@ -5,3 +5,17 @@ Source/BlankF4-2.launch
Source/StereoTurnerOnner.launch
Hardware/~$PSDR.pcb.inf
Hardware/Test Boards/~$MultiTestBoard2.pcb.inf
Hardware/PSDR.eco
Hardware/PSDR.rep
Hardware/PSDR_Layou1.pcb
Hardware/PSDR_Layou2.pcb
Hardware/PSDR_Layou3.pcb
Hardware/PSDR_Layout.pcb
Hardware/PSDR_Logic0.sch
Hardware/PSDR_Logic1.sch
Hardware/PSDR_Logic2.sch
Hardware/PSDR_Logic3.sch
Hardware/PSDR_PCB/3D/3DSettings.xml
Hardware/PSDR_PCB/PSDR_3DViewer.cce
Hardware/STM32F756_Config.ioc
Source/STM32F4 Test.launch

Binary file not shown.

View file

@ -1,5 +1,5 @@
#MicroXplorer Configuration settings - do not modify
File.Version=5
File.Version=6
KeepUserPlacement=false
Mcu.Family=STM32F4
Mcu.IP0=DAC
@ -49,22 +49,29 @@ Mcu.Pin33=PB5
Mcu.Pin34=PB6
Mcu.Pin35=PB7
Mcu.Pin36=VP_ADC1_TempSens_Input
Mcu.Pin37=VP_TIM1_VS_ControllerModeGated
Mcu.Pin38=VP_TIM1_VS_ClockSourceINT
Mcu.Pin39=VP_TIM4_VS_ClockSourceINT
Mcu.Pin37=VP_SYS_VS_Systick
Mcu.Pin38=VP_TIM1_VS_ControllerModeGated
Mcu.Pin39=VP_TIM1_VS_ClockSourceINT
Mcu.Pin4=PA1
Mcu.Pin40=VP_TIM4_VS_ClockSourceINT
Mcu.Pin5=PA4
Mcu.Pin6=PA5
Mcu.Pin7=PE7
Mcu.Pin8=PE9
Mcu.Pin9=PB10
Mcu.PinsNb=40
Mcu.PinsNb=41
Mcu.UserConstants=
Mcu.UserName=STM32F429VITx
MxCube.Version=4.12.0
MxDb.Version=DB.4.0.120
MxCube.Version=4.14.0
MxDb.Version=DB.4.0.140
NVIC.BusFault_IRQn=true\:0\:0\:false\:false\:false
NVIC.DebugMonitor_IRQn=true\:0\:0\:false\:false\:false
NVIC.HardFault_IRQn=true\:0\:0\:false\:false\:false
NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:false
NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:false
NVIC.PriorityGroup=NVIC_PRIORITYGROUP_0
NVIC.SysTick_IRQn=true\:0\:0\:false
NVIC.SysTick_IRQn=true\:0\:0\:false\:false\:true
NVIC.UsageFault_IRQn=true\:0\:0\:false\:false\:false
PA1.GPIOParameters=GPIO_Label
PA1.GPIO_Label=BOOT1
PA1.Locked=true
@ -79,7 +86,7 @@ PA13.Mode=Serial-Wire
PA13.Signal=SYS_JTMS-SWDIO
PA14.Mode=Serial-Wire
PA14.Signal=SYS_JTCK-SWCLK
PA15.Mode=NSS_Signal_Hard
PA15.Mode=NSS_Signal_Hard_Input
PA15.Signal=SPI1_NSS
PA4.Signal=COMP_DAC1_group
PA5.Signal=COMP_DAC2_group
@ -89,7 +96,7 @@ PB10.Mode=I2C
PB10.Signal=I2C2_SCL
PB11.Mode=I2C
PB11.Signal=I2C2_SDA
PB12.Mode=NSS_Signal_Hard
PB12.Mode=NSS_Signal_Hard_Input
PB12.Signal=SPI2_NSS
PB13.Mode=Full_Duplex_Master
PB13.Signal=SPI2_SCK
@ -145,7 +152,7 @@ PCC.Battery.SelfDischarge=10.0
PCC.Checker=false
PCC.Line=STM32F429/439
PCC.MCU=STM32F429V(E-G-I)Tx
PCC.MXVersion=4.12.0
PCC.MXVersion=4.14.0
PCC.PartNumber=STM32F429VITx
PCC.Seq0=0
PCC.Series=STM32F4
@ -180,7 +187,7 @@ RCC.EthernetFreq_Value=168000000
RCC.FCLKCortexFreq_Value=168000000
RCC.FamilyName=M
RCC.HCLKFreq_Value=168000000
RCC.HSE_VALUE=8000000
RCC.HSE_VALUE=26000000
RCC.HSI_VALUE=16000000
RCC.I2SClocksFreq_Value=96000000
RCC.IPParameters=LSI_VALUE,FamilyName,APB1CLKDivider,HSE_VALUE,HSI_VALUE,RTCHSEDivFreq_Value,VCOInputFreq_Value,VCOSAIOutputFreq_Value,VCOSAIOutputFreq_ValueR,LCDTFTFreq_Value,VCOSAIOutputFreq_ValueQ,VCOOutputFreq_Value,PLLCLKFreq_Value,PLLQCLKFreq_Value,VCOI2SOutputFreq_Value,VcooutputI2S,I2SClocksFreq_Value,VcooutputI2SQ,SYSCLKFreq_VALUE,AHBFreq_Value,HCLKFreq_Value,CortexFreq_Value,FCLKCortexFreq_Value,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,EthernetFreq_Value,MCO2PinFreq_Value,RTCFreq_Value,SAI_AClocksFreq_Value,SAI_BClocksFreq_Value,48MHZClocksFreq_Value,APB2CLKDivider,PLLM,PLLN,SYSCLKSource,PLLQ
@ -188,12 +195,12 @@ RCC.LCDTFTFreq_Value=12250000
RCC.LSI_VALUE=32000
RCC.MCO2PinFreq_Value=168000000
RCC.PLLCLKFreq_Value=168000000
RCC.PLLM=8
RCC.PLLM=26
RCC.PLLN=336
RCC.PLLQ=7
RCC.PLLQCLKFreq_Value=48000000
RCC.RTCFreq_Value=32000
RCC.RTCHSEDivFreq_Value=4000000
RCC.RTCHSEDivFreq_Value=13000000
RCC.SAI_AClocksFreq_Value=12250000
RCC.SAI_BClocksFreq_Value=12250000
RCC.SYSCLKFreq_VALUE=168000000
@ -219,15 +226,19 @@ SH.S_TIM1_ETR.0=TIM1_ETR,TriggerSource_ETR
SH.S_TIM1_ETR.ConfNb=1
SH.S_TIM4_CH1.0=TIM4_CH1,Output Compare1 CH1
SH.S_TIM4_CH1.ConfNb=1
SPI1.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_2
SPI1.CalculateBaudRate=42.0 MBits/s
SPI1.IPParameters=Mode,CalculateBaudRate,VirtualNSS
SPI1.IPParameters=Mode,CalculateBaudRate,VirtualNSS,BaudRatePrescaler
SPI1.Mode=SPI_MODE_MASTER
SPI1.VirtualNSS=VM_NSSHARD
SPI2.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_2
SPI2.CalculateBaudRate=21.0 MBits/s
SPI2.IPParameters=Mode,CalculateBaudRate,VirtualNSS
SPI2.IPParameters=Mode,CalculateBaudRate,VirtualNSS,BaudRatePrescaler
SPI2.Mode=SPI_MODE_MASTER
SPI2.VirtualNSS=VM_NSSHARD
VP_ADC1_TempSens_Input.Signal=ADC1_TempSens_Input
VP_SYS_VS_Systick.Mode=SysTick
VP_SYS_VS_Systick.Signal=SYS_VS_Systick
VP_TIM1_VS_ClockSourceINT.Mode=Internal
VP_TIM1_VS_ClockSourceINT.Signal=TIM1_VS_ClockSourceINT
VP_TIM1_VS_ControllerModeGated.Mode=Gated Mode

View file

@ -107,7 +107,7 @@ void TinyGPS_init()
}
//Initial Uart setup
uart_init(hal_gpsUart);
//uart_init(hal_gpsUart);
#ifdef SIRF_MODULE
//TODO: Determine which of these delays can be eliminated or reduced
@ -139,7 +139,7 @@ void TinyGPS_init()
#endif
#ifdef MEDIATEK_MODULE
//Send it something to wake it up
uart_write(hal_gpsUart, "\r\n", 2);
//uart_write(hal_gpsUart, "\r\n", 2);
#endif
}

View file

@ -709,7 +709,6 @@ USART1_IRQHandler(void)
}
GPIO_InitTypeDef GPIO_InitStruct;
__IO ITStatus UartReady = RESET;
uint8_t aTxBuffer[] = "Chris a baby! ";
@ -717,38 +716,58 @@ uint8_t aRxBuffer[256];
void configUartPeripheral()
{
// //Enable Clocks
// __GPIOB_CLK_ENABLE();
// __USART1_CLK_ENABLE();
//
__GPIOC_CLK_ENABLE();
__USART6_CLK_ENABLE();
GPIO_InitTypeDef GPIO_InitStruct;
// //Setup TX Pin
// GPIO_InitStruct.Pin = GPIO_PIN_6;
// GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
// GPIO_InitStruct.Pull = GPIO_NOPULL;
// GPIO_InitStruct.Speed = GPIO_SPEED_FAST;
// GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
//
// HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
//
// //Setup RX Pin
// //It doesn't get set as an input?
// GPIO_InitStruct.Pin = GPIO_PIN_7;
// GPIO_InitStruct.Alternate = GPIO_AF7_USART1;
//
// HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
//
GPIO_InitStruct.Pin = RX_TO_GPS.pin;
GPIO_InitStruct.Mode = GPIO_MODE_AF_PP;
GPIO_InitStruct.Pull = GPIO_NOPULL;
GPIO_InitStruct.Speed = GPIO_SPEED_FAST;
GPIO_InitStruct.Alternate = GPIO_AF8_USART6;
HAL_GPIO_Init(RX_TO_GPS.port, &GPIO_InitStruct);
//Setup RX Pin
//It doesn't get set as an input?
GPIO_InitStruct.Pin = TX_FROM_GPS.pin;
GPIO_InitStruct.Alternate = GPIO_AF8_USART6;
HAL_GPIO_Init(TX_FROM_GPS.port, &GPIO_InitStruct);
// //Configure NVIC
// HAL_NVIC_SetPriority(USART1_IRQn, 0, 1);
// HAL_NVIC_EnableIRQ(USART1_IRQn);
//
// UartHandle.Instance = USART1;
// UartHandle.Init.BaudRate = 9600;
// UartHandle.Init.WordLength = UART_WORDLENGTH_8B;
// UartHandle.Init.StopBits = UART_STOPBITS_1;
// UartHandle.Init.Parity = UART_PARITY_NONE;
// UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
// UartHandle.Init.Mode = UART_MODE_TX_RX;
//
// HAL_UART_Init(&UartHandle);
UartHandle.Instance = USART6;
UartHandle.Init.BaudRate = 9600;
UartHandle.Init.WordLength = UART_WORDLENGTH_8B;
UartHandle.Init.StopBits = UART_STOPBITS_1;
UartHandle.Init.Parity = UART_PARITY_NONE;
UartHandle.Init.HwFlowCtl = UART_HWCONTROL_NONE;
UartHandle.Init.Mode = UART_MODE_TX_RX;
UartHandle.Init.OverSampling = UART_OVERSAMPLING_16;
if(HAL_UART_Init(&UartHandle) != HAL_OK)
{
trace_puts("UART didn't init rightly.");
}
TinyGPS_init();
while(1)
{
if(HAL_UART_Receive(&UartHandle, (uint8_t *)aRxBuffer, 256, 5000) != HAL_OK)
{
trace_puts("UART recieve didn't work. No sir.");
} else {
trace_puts(aRxBuffer);
for(int i = 0; i < 256; i++)
TinyGPS_encode(aRxBuffer[i]);
}
}
}