Thanks.
I never used hardware serial port
according to the datasheet for 16F886, there are 4 pins dedicated to the MSSP moduie
RA5 - SS
RC3- SCK/SCL
RC4- SDI/SDA
RC5 - SDO
Which one should I use for serial GPS, as these seem to be for SPI/I2C ?
Thanks.
I never used hardware serial port
according to the datasheet for 16F886, there are 4 pins dedicated to the MSSP moduie
RA5 - SS
RC3- SCK/SCL
RC4- SDI/SDA
RC5 - SDO
Which one should I use for serial GPS, as these seem to be for SPI/I2C ?
None of these.
We are talking about USART and not MSSP.
The pins of interest are RC7 as Usart Rx pin and RC6 as Usart Tx pin.
You have once to set the appropriate registers at the top of your program and start enjoy the speed and reliability of the serial port.
IoannisCode:DEFINE HSER_RCSTA 90h DEFINE HSER_TXSTA 24h '9600 baud rate, BRGH=1 @8MHz clock DEFINE HSER_BAUD 9600 DEFINE HSER_SPBRG 25 DEFINE HSER_CLROERR 1
I think that settings are incorrect, because
aska:
hserout ["Init:",10,13]
pause 200
goto aska
Outputs something not correct, like question marks.
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 24h '9600 baud rate, BRGH=1 @8MHz clock
DEFINE HSER_BAUD 9600
DEFINE HSER_SPBRG 25
DEFINE HSER_CLROERR 1
these might need tuning?
The output is TTL logic. Meaning you have to use a RS-232 driver to use it with PC. Either a transistor or a MAX232 type chip.
Ioannis
I'm using USB serial adapter with TTL logic, which works just fine with SEROUT2/SERIN2 statements.
Fixed it
just tried all values for
DEFINE HSER_SPBRG 50
and 50 worked.
Now will try to read GPS![]()
But that does not work for GPS
reading junk again, and more weird junk![]()
Bookmarks