Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

flush RCREG in USART

Status
Not open for further replies.
Yes but TXIF is set anytime you set TXEN ...
Yes, that's right. TXIF = 1 indicates TXREG is empty and that it's ok to write a new character to TXREG. In fact that's why we use TXIF for interrupt driven serial I/O with circular buffers. The TXIF flag lets our ISR "pull" code know it can send another TX character from the circular buffer. The ISR "pull" code clears TXIE on "buffer empty" and the "push" routine in main will set TXIE when it adds a character to the circular buffer.

... whereas TRMT is clear up until the transmit is complete. Thus you can load TXREG, then have your code go off and do other things, then poll the TRMT bit prior to transmitting the next byte. This way your code isn't tied to the UART during the transmit period.
My TXIF example does the same thing Jon. TXIF goes low when you stuff TXREG and goes high when TXREG is empty.
 
Last edited:
Ah OK...they don't explain that very well in the 16F628 datasheet. I haven't checked yet but perhaps they have a better explanation of that flag in the 16F Mid-Range Reference Manual?

On another note...I've tried to find it on Microchip's site and could not for the life of me find a place to order hard copies of data sheets and the MRM. I usually will print out a hard copy, but after doing a few of them you can only imagine how much ink that takes up. Do you or does anyone know if they're obtainable online or do I have to call Microchip to request hard copies of technical data?
 
Last edited:
On another note...I've tried to find it on Microchip's site and could not for the life of me find a place to order hard copies of data sheets and the MRM. I usually will print out a hard copy, but after doing a few of them you can only imagine how much ink that takes up. Do you or does anyone know if they're obtainable online or do I have to call Microchip to request hard copies of technical data?
Why print it? I print the pinout page and any other single page(s) that I use real often. For the rest I just always have a PDF reader running and ALT-TAB to it when I need to know something. With a widescreen monitor you can usually arrange it so MPLAB and the PDF reader can both fit and be seen at the same time. If you have multiple datasheets open in the PDF reader, use CTRL-TAB to flip between them.

You can't do a quick search for something on a paper copy like you can on a PDF. :D

This is on a small 20" widescreen - only 1680x1050 resolution. It's much nicer on the 24" 1920x1080 I used to have on this desk. I'm going to get another soon and give this little thing back to its owner (I was using it to troubleshoot a strange firmware problem it has).
bleh.jpg
 
Last edited:
Why print it? I print the pinout page and any other single page(s) that I use real often. For the rest I just always have a PDF reader running and ALT-TAB to it when I need to know something. With a widescreen monitor you can usually arrange it so MPLAB and the PDF reader can both fit and be seen at the same time. If you have multiple datasheets open in the PDF reader, use CTRL-TAB to flip between them.

You can't do a quick search for something on a paper copy like you can on a PDF. :D

This is on a small 20" widescreen - only 1680x1050 resolution. It's much nicer on the 24" 1920x1080 I used to have on this desk. I'm going to get another soon and give this little thing back to its owner (I was using it to troubleshoot a strange firmware problem it has).
View attachment 49423

The main reason for the hard copies is so that I can read them wherever I'm at and not have to be at the computer all the time to read a datasheet.

I'm in the process of assembling a second machine though that will go on my bench so that I have MPLAB and data sheets available to me when I'm at the bench.
 
The main reason for the hard copies is so that I can read them wherever I'm at and not have to be at the computer all the time to read a datasheet.

Hi,

Well I used to be as sad as that too :D

Printing out datasheets and reference manuals will cost you a fortune in paper and toner cartrigdes.

If you must read them when away from the main PC can not you load pdfs onto these modern tablet devices - a lot easier than 400 pages of A4 on your lap ! - and resorting them after they drop out of the ring binder !!
 
Considering the price of ink/toner these days, 1 uC datasheet worth of ink would buy a new Kindle ($140).

They are nice to have on the bench.
I find that I surf too much to get anything done when I have a computer on my bench.

BUT, I was only test-driving the Kindle and loading it up as a gift for Christmas...so now it is gone and I have to take my own advice.

You can surf the net for free, and download the PDFs as needed. nice tool.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top