I'm using a PIC16F628 to build a serial DC motor driver. I thought of using the UART port to wake the PIC when a new command comes in. What are the considerations for using the UART ? Should I use a interrupt or just check the port in a tight loop ? If I want to preserve power, will sleeping between serial command improved more than fractionally the power consumption ? Thanks, Shachar Weis. |
|

Serial Motor driver - to UART or not to UART
From the datasheet it looks like the supply current will drop from 4 mA to 2 uA - that is a bunch! It may not be meaningful if the circuit is powered by a wall wart but it is a lot for a small battery. The UART is the right way to handle serial I/O whether you use interrupts or not. Apparently, the UART can wake up the processor if the Peripheral Interrupt is enabled whether or not the Global Interrupt Enable is set. Using the UART is a walk down the yellow brick road - the directions are all in the datasheet. There will be other opinions but I would use a MAX233 to convert the CMOS/TTL levels to true RS232. I like the device even though it is expensive because it doesn't require external charge pump capacitors. Others will point out that a few resistors and a transistor can "almost" meet the RS232 requirements. Caveat emptor! --- In , "holopoint.rm" <holopoint@r...> wrote: > I'm using a PIC16F628 to build a serial DC motor driver. > I thought of using the UART port to wake the PIC > when a new command comes in. > What are the considerations for using the UART ? > Should I use a interrupt or just check the port in a tight loop ? > If I want to preserve power, will sleeping between serial command > improved more than fractionally the power consumption ? > > Thanks, > Shachar Weis. |
|
what is "caveat emptor" ? A few resistor will solve the RS232 requirements not "almost" but sure ! Of course ( and you know well) first the RS232 specifications must be readed. ITU requirements also. Finally the reader will understand why a little transistor and a few resistors are ok for many applications. Not for 900m RS232, where even the MAX233 is not suitable. Only expensive. And depends very much about what is on the other RS232 end. Because the current capabilities of MAX233 are limited. :)) top 10 wishes, Vasile http://surducan.netfirms.com On Thu, 26 Jun 2003, rtstofer wrote: > > >From the datasheet it looks like the supply current will drop from 4 > mA to 2 uA - that is a bunch! It may not be meaningful if the > circuit is powered by a wall wart but it is a lot for a small battery. > > The UART is the right way to handle serial I/O whether you use > interrupts or not. Apparently, the UART can wake up the processor if > the Peripheral Interrupt is enabled whether or not the Global > Interrupt Enable is set. > > Using the UART is a walk down the yellow brick road - the directions > are all in the datasheet. There will be other opinions but I would > use a MAX233 to convert the CMOS/TTL levels to true RS232. I like > the device even though it is expensive because it doesn't require > external charge pump capacitors. > > Others will point out that a few resistors and a transistor > can "almost" meet the RS232 requirements. Caveat emptor! > --- In , "holopoint.rm" <holopoint@r...> wrote: > > I'm using a PIC16F628 to build a serial DC motor driver. > > I thought of using the UART port to wake the PIC > > when a new command comes in. > > What are the considerations for using the UART ? > > Should I use a interrupt or just check the port in a tight loop ? > > If I want to preserve power, will sleeping between serial command > > improved more than fractionally the power consumption ? > > > > Thanks, > > Shachar Weis. > > to unsubscribe, go to http://www.yahoogroups.com and follow the instructions > > ">http://docs.yahoo.com/info/terms/ |
|
----- Original Message ----- From: "Vasile Surducan" <> To: <> Sent: Thursday, June 26, 2003 2:39 AM Subject: Re: [piclist] Re: Serial Motor driver - to UART or not to UART > > what is "caveat emptor" ? let the buyer beware > > A few resistor will solve the RS232 requirements not "almost" but sure ! > Of course ( and you know well) first the RS232 specifications must be > readed. ITU requirements also. Finally the reader will understand why > a little transistor and a few resistors are ok for many applications. > Not for 900m RS232, where even the MAX233 is not suitable. Only expensive. > And depends very much about what is on the other RS232 end. Because the > current capabilities of MAX233 are limited. > :)) > > top 10 wishes, > Vasile > http://surducan.netfirms.com > On Thu, 26 Jun 2003, rtstofer wrote: > > > > > >From the datasheet it looks like the supply current will drop from 4 > > mA to 2 uA - that is a bunch! It may not be meaningful if the > > circuit is powered by a wall wart but it is a lot for a small battery. > > > > The UART is the right way to handle serial I/O whether you use > > interrupts or not. Apparently, the UART can wake up the processor if > > the Peripheral Interrupt is enabled whether or not the Global > > Interrupt Enable is set. > > > > Using the UART is a walk down the yellow brick road - the directions > > are all in the datasheet. There will be other opinions but I would > > use a MAX233 to convert the CMOS/TTL levels to true RS232. I like > > the device even though it is expensive because it doesn't require > > external charge pump capacitors. > > > > Others will point out that a few resistors and a transistor > > can "almost" meet the RS232 requirements. Caveat emptor! > > > > > > --- In , "holopoint.rm" <holopoint@r...> wrote: > > > I'm using a PIC16F628 to build a serial DC motor driver. > > > I thought of using the UART port to wake the PIC > > > when a new command comes in. > > > What are the considerations for using the UART ? > > > Should I use a interrupt or just check the port in a tight loop ? > > > If I want to preserve power, will sleeping between serial command > > > improved more than fractionally the power consumption ? > > > > > > Thanks, > > > Shachar Weis. > > > > > > > > to unsubscribe, go to http://www.yahoogroups.com and follow the instructions > > > > ">http://docs.yahoo.com/info/terms/ > > > > > to unsubscribe, go to http://www.yahoogroups.com and follow the instructions > > ">http://docs.yahoo.com/info/terms/ > |
On Thursday 26 Jun 2003 8:39 am, Vasile Surducan wrote: > what is "caveat emptor" ? Buyer beware. Ian |
--- In , Vasile Surducan <vasile@s...> wrote: > A few resistor will solve the RS232 requirements not "almost" but sure ! Where does the negative voltage come from? The minimum requirements are -3V for logic 1 and +3V for logic 0. The maximums are -25V and +25V. MAXIM (and others) didn't go to all the work of creating charge pumps for +10V and -10V if 0V and +5V would ALWAYS work. I know that almost every PC in the world will accept 0V for logic 1 but not every other kind of device. I still have an old Televideo 950 CRT that is quite picky about signal levels - 0V will NOT work! I have seen circuits that get the negative voltage from one of the other pins but in one way or another there is a limitation on using the circuit. One of the more popular circuits steals the voltage from the PCs TXD signal but it is limited to half duplex transmission. I have seen other circuits attempting to build a charge pump out of the incoming signals. That approach requires a certain amount of incoming data to keep the pump charged. Still a limitation. In fact, I have seen entire circuits powered this way! Will a transistor and a few resistors work? Sure - if the destination is a PC. |
