emkay
Junior Member level 2
uart read write gps
Currently I try to develop tracking system, which use dual USART using PIC16F628A, I used hardware USART and also software USART. The software USART handle the data receiving from GPS while the hardware to receive and transmit the data to/from GSM modem.
The system flow is to receive data from GPS and store into EEPROM (24LC512) then transmit the data through GSM modem after dedicated period (might be 24hrs). I’ll set the interval for receiving the data form GPS for a minute (may change later).
Instead of transmitting the data for fixed period, the ‘server/user’ can request the data at anytime.
Both of my USART routine use interrupts to handle the task, but I have a problem to manage this thing. My plan is after receive the interrupt for GPS, I’ll filter the data to meet my requirement (time and location only), and then store/write that data to the 24LC512 and the system will wait for the interrupt from hardware USART (a call from ‘user’) for a less than a minute (because my interval to receive the GPS data is one minute…I do not want to ‘disturb’ my data collection).
My question is, what will happen if during receiving the GPS data, the second interrupt (hardware USART) occurred, what would PIC do? Continue collecting data (because still in external interrupt) OR will respond to the second one?
I want my PIC, finished the first task (receive- filter store to 24LC512) before respond to the second interrupt. So how to do this? …How to give priority to the first interrupt?
And it will be same case if my hardware USART interrupt occurred first then suddenly the data from GPS coming…I want my hardware USART settle the job first before proceed to the receiving the GPS data. The task under USART hardware is…(receive call form ‘user’ pickup the ‘phone’ read data from 24LC512 transmit the data)
Both case need to settle the first one before proceed to the second interrupt…
Your comment and advice are highly appreciated…
If there are similar reference project, please forward to me.
Thanks in advance
Currently I try to develop tracking system, which use dual USART using PIC16F628A, I used hardware USART and also software USART. The software USART handle the data receiving from GPS while the hardware to receive and transmit the data to/from GSM modem.
The system flow is to receive data from GPS and store into EEPROM (24LC512) then transmit the data through GSM modem after dedicated period (might be 24hrs). I’ll set the interval for receiving the data form GPS for a minute (may change later).
Instead of transmitting the data for fixed period, the ‘server/user’ can request the data at anytime.
Both of my USART routine use interrupts to handle the task, but I have a problem to manage this thing. My plan is after receive the interrupt for GPS, I’ll filter the data to meet my requirement (time and location only), and then store/write that data to the 24LC512 and the system will wait for the interrupt from hardware USART (a call from ‘user’) for a less than a minute (because my interval to receive the GPS data is one minute…I do not want to ‘disturb’ my data collection).
My question is, what will happen if during receiving the GPS data, the second interrupt (hardware USART) occurred, what would PIC do? Continue collecting data (because still in external interrupt) OR will respond to the second one?
I want my PIC, finished the first task (receive- filter store to 24LC512) before respond to the second interrupt. So how to do this? …How to give priority to the first interrupt?
And it will be same case if my hardware USART interrupt occurred first then suddenly the data from GPS coming…I want my hardware USART settle the job first before proceed to the receiving the GPS data. The task under USART hardware is…(receive call form ‘user’ pickup the ‘phone’ read data from 24LC512 transmit the data)
Both case need to settle the first one before proceed to the second interrupt…
Your comment and advice are highly appreciated…
If there are similar reference project, please forward to me.
Thanks in advance