Thank you a lot Henrik for the advises ill work on it when i get back from college.
Thank you a lot Henrik for the advises ill work on it when i get back from college.
Last edited by xapmanis; - 9th April 2013 at 07:46.
Hello Henrik, I got back home and did run some tests. I found what i did wrong !! I did put wrong defines.
The only defines a simple HSEROUT/HSERIN needs are:
DEFINE HSER_RCSTA 90h 'Hser receive status init
DEFINE HSER_TXSTA 20h 'Hser transmit status init
DEFINE HSER_BAUD 9600 'Hser baud rate
DEFINE HSER_CLROERR 1 'Hser clear overflow automatically
The thing that put me through trouble was that
DEFINE HSER_BAUD 9600 and DEFINE HSER_SPBRG 25 does the same thing, they set the BaudRate and u can't use them both (what i did !!) :P
Mistakes on pics can sometimes drive me crazy !! Thank you for your reply![]()
Regards, Kostas
Hello Henrik, I got back home and did run some tests. I found what i did wrong !! I did put wrong defines.
The only defines a simple HSEROUT/HSERIN needs are:
DEFINE HSER_RCSTA 90h 'Hser receive status init
DEFINE HSER_TXSTA 20h 'Hser transmit status init
DEFINE HSER_BAUD 9600 'Hser baud rate
DEFINE HSER_CLROERR 1 'Hser clear overflow automatically
The thing that put me through trouble was that
DEFINE HSER_BAUD 9600 and DEFINE HSER_SPBRG 25 does the same thing, they set the BaudRate and u can't use them both (what i did !!) :P
Mistakes on pics can sometimes drive me crazy !! Thank you for your reply![]()
Regards, Kostas
Hi
When using the PIC USART the Tx pin should be set to INPUT, not output as you would expect.
See PIC 18F2x/4xK22 datasheet page 270 section 16.1.1.7
Phil
Hey phil, i just read page 270. It's true what you said but it seems to work both ways. I think Hserout/Hserin sets TRIS register automatically.
Regards Kostas.
Bookmarks