If I read , I see that to be able to attach my PIC (16F628) to my computer, I still have to circuit in a MAX232. On top of that I(actually Nigel did it for us already) have to code up the RS232 protocol.
So I am thinking wtf is the UART claimed to be in the PIC good for ?
sorry for noob question. Perhaps the UART definition doesnt cover 5<->12v conversion and the RS232 protocol. So what is it supposed to mean ?
If I read , I see that to be able to attach my PIC (16F628) to my computer, I still have to circuit in a MAX232. On top of that I(actually Nigel did it for us already) have to code up the RS232 protocol.
So I am thinking wtf is the UART claimed to be in the PIC good for ?
sorry for noob question. Perhaps the UART definition doesnt cover 5<->12v conversion and the RS232 protocol. So what is it supposed to mean ?
The UART does the serial transmission and reception in hardware, if you want RS232 you still need a MAX232 or some other level shifter and inverter. The advantage of using the UART is that it's fast and takes hardly any processor time, and can even be interrupt driven - the disadvantage is that you need an inverter for RS232, and that it uses fixed pins. The software method means you can use pretty well any pins, and don't require an inverter (you can invert in software) which means you can use a simple resistor for a crude RS232.
I think that should be "level shifter or inverter".
What Nigel is saying is that the UART/USART sends and recieves data (0s and 1s) using the voltage defined by the logic family it is implemented in. For TTL compatiable logic this would be +5V for 1 and 0V for ground.
RS232 defines the logic levels to be -12V and +12V. This is done to allow the singnals to travel further without degrading. For even greater distance you can use other specs like RS422. You can convert a UART signal to either of these using the correct level shifter. For RS232 we now use a single chip like the MAX232. In the past we used to used on chip to send and another to recieve.
In some cases you can do without the MAX232 and fake a level shifter using resistors. Buy you still have to invert the TTL level signal either in hardware or software.
hi,
I think if you look around you will find that most, if not all freestanding UART's require additional hardware for level shifting
and inversion, if they are to meet the RS232 serial protocol standard.
They also require coding within any program for correct initailising and operation, so they are no different from the UART within a PIC.
Even the UART in your PC has level shifting and inversion.
No, it needs to do BOTH - using a software UART you can use just a single resistor (check the BASIC STAMP), because you can invert it in the software, you can't do this with the hardware UART though.
Isnt Nigels code sending/receiving data a bit at a time handling the time to wait between each bit ? If so, MAX232 plus the software is doing everything. What is the uart doing ?
It can be done using any pins ? why only the UART pins ?
Isnt Nigels code sending/receiving data a bit at a time handling the time to wait between each bit ? If so, MAX232 plus the software is doing everything. What is the uart doing ?
The UART isn't used on the earlier tutorials, ONLY on the last one. The software UART routines do all the timing in the software, the final hardware UART tutorial uses the UART hardware to do it all.
It can be done using any pins ? why only the UART pins ?
That you can be asking these questions reveals a complete lack of understanding or appreciation. I recommend that you go back to the datasheets and read them very carefully. If you do, you will note the lack of shift registers and control logic in the MAX232 family of chips. If you read the section of the PIC data sheet that talks about the UART, you will notice a complete lack of circuits which deal with converting logic level signals to RS-232 levels. You cannot be so bovine as to think that a UART and a MAX232 chip perform the same function.
You don't need two seperate devices, you need one that does BOTH though (like a MAX232), but BOTH functions are required. As long as you stick to hardware UART's and MAX232's you don't need to know about it, but if you're using software UART's or non-MAX232 methods, then it's something you have to be VERY aware of.
I guess the juniors at Cornell in Ithaca are braver and smarter than the guys in So California. USB hardware - they don't need no steenkin' USB hardware. Ohhh...Raaaah!
I guess the juniors at Cornell in Ithaca are braver and smarter than the guys in So California. USB hardware - they don't need no steenkin' USB hardware. Ohhh...Raaaah!