|
|
View previous topic :: View next topic |
Author |
Message |
dbotkin
Joined: 08 Sep 2003 Posts: 197 Location: Omaha NE USA
|
|
Posted: Fri Nov 01, 2013 1:05 pm |
|
|
ckielstra wrote: | dbotkin wrote: | How about a device whose UART pins I can MOVE at will? Bingo. 16F1827/1847. | There are even more PICs that can do this than the two models you reference here.
I'm surprised you consider changing processor as the PIC16F1459 has USB and you are dropping that feature now. From what we know for your project even the dirt cheap 8-pin PIC12F1822 might do the job. It has a hardware UART with switch-able pin configuration on the UART.
Quote: | And if I'm going to resort to that, I may as well set the SPBRGH:SPBRGL registers myself, too. | Well, yes, you can hard code everything if you want to, but what's wrong in using the set_uart_speed() function? That's doing exactly that for the hardware UART. |
As I got further into the design, I realized that I could just drop the USB interface altogether. I had originally planned to make this add-on option board a lot "smarter", but have since refactored the design so that all of the functions that are remotely likely to change over time are on the host board, which can be updated. Giving up the USB port was easy at that point; it was never going to be used for more than enabling possible future field upgrades with the USB bootloader.
While I love the 12F1822 (in fact, I use thousands of the 12F1840) I do need more pins than that. An 18-pin is about where I need to be. The 16F1827/47 has a few things that will make coding some features MUCH easier. I found a few other candidates, but many (for example) won't let you use the FVR as the ADC reference voltage -- something that makes using an LM35-type temperature sensor a lot easier. The internal temp sensor isn't really a good option due to its need for calibration. This one will let me swap the RX pin and use the VFR the way I want to, it's got the pin count I need and is pretty inexpensive.
There may well be an even better solution -- a PIC with all the features I need to do the job, at a lower cost than the 16F18x7 -- or maybe not. The existing selection tools simply aren't fine-grained enough to tell me, and I've spent enough time sorting through data sheets to see exactly what they will and won't do. Saving that last nickel isn't a big deal. :)
ttelmah wrote: | It is worth pointing out that the manual for set_uart_speed, says:
"Changes the baud rate of the built-in hardware RS232 serial port at run-time. "
Couldn't really be much plainer. |
Very true. The only thing "buggy" is that if you specify the stream name of a software UART, it changes the speed of a different port -- with no warning or error messages. |
|
|
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Fri Nov 01, 2013 2:51 pm |
|
|
Thanks for the explanation, now it makes all more sense.
About set_uart_speed(), the bug you mentioned is for a software UART and you are going to use the hardware UART. Shouldn't be a problem and makes for easier to read code. But good to keep in mind when things are not working as expected. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|