Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Thread

LPC2148 USB samples (not working)

LPC2148 USB samples (not working)

2006-01-13 by Carsten Grøn

Hello,

I have been playing around with some of the USB samples from Keil 
etc, and been trying to get just one of them to run on a LPC2148 
board from www.embeddedartists.com (very nice boards btw) but I'm 
having some problems. Well, actually it's the sam eproblem no matter 
which sample I try, I always get a message from Win2K "Unknown 
device....."....
Now, before I bury myself deeeeeep into the "unknown of USB", is 
there something I need to be aware of when running some of these 
samples ? The LPC2148 board has P0.31 switching the USB+ to 3V3, and 
P0.23 senses Vcc from the USB host, which should be the same as the 
Keil MC2140 board......
The same thing happens with the Keil usbmem, usbhid and the philips 
vcom sample (the keil audio reports an internal linker error when I 
try to build that....)

So, something I must be doing wrong, any leads ???

(PS: I have ported uIP to a LPC2138 Ethernet board from 
embeddedartists running with the Keil RTX RTOS, working very nicely)



Carsten

Re: [lpc2000] LPC2148 USB samples (not working)

2006-01-13 by Bertrik Sikken

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Carsten Gr\ufffdn wrote:
> Hello,
> 
> I have been playing around with some of the USB samples from Keil
> etc, and been trying to get just one of them to run on a LPC2148
> board from www.embeddedartists.com (very nice boards btw) but I'm
> having some problems. Well, actually it's the sam eproblem no matter
> which sample I try, I always get a message from Win2K "Unknown
> device....."....
> Now, before I bury myself deeeeeep into the "unknown of USB", is
> there something I need to be aware of when running some of these
> samples ? The LPC2148 board has P0.31 switching the USB+ to 3V3, and
> P0.23 senses Vcc from the USB host, which should be the same as the
> Keil MC2140 board......
> The same thing happens with the Keil usbmem, usbhid and the philips
> vcom sample (the keil audio reports an internal linker error when I
> try to build that....)
> 
> So, something I must be doing wrong, any leads ???
> 
> (PS: I have ported uIP to a LPC2138 Ethernet board from
> embeddedartists running with the Keil RTX RTOS, working very nicely)

I too have an LP2148 from embedded artists and I just got the usbmem
example working with gcc to the point that windows recognises my
board as a mass-storage device with the proper USB device descriptors
(product/vendor id, strings descriptor, etc.)

USB mass storage itself is not quite working yet, although windows
properly recognises the size of the disk (at 16 kB).

I think the relevant steps to make it work were:
* the P0.31 pin should be configured for the USB 'CONNECT' function
* aggressive packing of all USB related structs by means of
  '__attribute ((packed))' and of every 'sub-struct' within those
  structs.
* aligning several structures to 32-bit boundaries, using
  '__attribute ((aligned(4)))'
* replacing __irq by '__attribute__ ((interrupt))'
* (I just removed some of the '__at' directives)
* Modifying the for-loop in USB_ReadEP into
  for (n = 0; n < (cnt + 3) / 4; n++) {
	dw = RX_DATA;
	*pData++ = dw >> 0;
	*pData++ = dw >> 8;
	*pData++ = dw >> 16;
	*pData++ = dw >> 24;
  }
* Modifying the for-loop in USB_WriteEP into
  for (n = 0; n < (cnt + 3) / 4; n++) {
    TX_DATA = (pData[3] << 24) | (pData[2] << 16) | (pData[1] << 8) |
pData[0];
    pData += 4;
  }
(there used to be some __packed directive in these parts in the
Keil code)

I may have changed some other stuff, but I think the list above
are the most significant changes.

Some very useful tools in making it work so far, were:
* OpenOCD in combination with a wiggler clone and arm-elf-insight.
  OpenOCD is similar to what OCDRemote does, except this is open-source
  http://developer.berlios.de/projects/openocd
* "usb in a nutshell", a really good document describing the essence
  of USB, at
  http://www.beyondlogic.org/usbnutshell/usb-in-a-nutshell.pdf
* usbsnoop, a windows USB packet sniffer, see:
  http://benoit.papillault.free.fr/usbsnoop

Kind regards,
Bertrik
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDx/4iETD6mlrWxPURAnaXAJ46r76Yzi/5+YR16aypISUGCIC3fQCgl1HE
Dss2pAvZbJVHFWL2KAZQevc=
=XTft
-----END PGP SIGNATURE-----

Re: LPC2148 USB samples (not working)

2006-01-13 by Carsten Grøn

Some further info:

I basically just added the "soft connect" to the Keil USBHID sample:
PINSEL1 |= 0x80004000;

and then changed the LED's to something meaningfull on my 
testboard...but only get the "unknown device...." popup from 
Win2K....

Any ideas ?

Carsten



--- In lpc2000@...m, Carsten Grøn <cgroen@m...> wrote:
>
> Hello,
> 
> I have been playing around with some of the USB samples from Keil 
> etc, and been trying to get just one of them to run on a LPC2148 
> board from www.embeddedartists.com (very nice boards btw) but I'm 
> having some problems. Well, actually it's the sam eproblem no 
matter 
> which sample I try, I always get a message from Win2K "Unknown 
> device....."....
> Now, before I bury myself deeeeeep into the "unknown of USB", is 
> there something I need to be aware of when running some of these 
> samples ? The LPC2148 board has P0.31 switching the USB+ to 3V3, 
and 
> P0.23 senses Vcc from the USB host, which should be the same as 
the 
> Keil MC2140 board......
> The same thing happens with the Keil usbmem, usbhid and the 
philips 
> vcom sample (the keil audio reports an internal linker error when 
I 
> try to build that....)
> 
> So, something I must be doing wrong, any leads ???
> 
> (PS: I have ported uIP to a LPC2138 Ethernet board from 
> embeddedartists running with the Keil RTX RTOS, working very 
nicely)
Show quoted textHide quoted text
> 
> 
> 
> Carsten
>

Re: LPC2148 USB samples (not working)

2006-01-13 by Carsten Grøn

Thanks for the comments Bertrik !

I'm currently using Keil and their ULINK JTAG, and the sample from 
their own website USBHID (also tried the USBMEM, same result). I 
_think_ that the hw of the embedded artists board and the keil board 
are more or less the same (P0.23 and P0.31), but still no success.
The packed "stuff" should be ok (I guess) as they must have it 
running on their own board/using their own compiler.

(I got some of the "packing" trouble when I ported the uIP to the 
keil :o)

Carsten




--- In lpc2000@yahoogroups.com, Bertrik Sikken <bertrik@z...> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Carsten Grøn wrote:
> > Hello,
> > 
> > I have been playing around with some of the USB samples from Keil
> > etc, and been trying to get just one of them to run on a LPC2148
> > board from www.embeddedartists.com (very nice boards btw) but I'm
> > having some problems. Well, actually it's the sam eproblem no 
matter
> > which sample I try, I always get a message from Win2K "Unknown
> > device....."....
> > Now, before I bury myself deeeeeep into the "unknown of USB", is
> > there something I need to be aware of when running some of these
> > samples ? The LPC2148 board has P0.31 switching the USB+ to 3V3, 
and
> > P0.23 senses Vcc from the USB host, which should be the same as 
the
> > Keil MC2140 board......
> > The same thing happens with the Keil usbmem, usbhid and the 
philips
> > vcom sample (the keil audio reports an internal linker error 
when I
> > try to build that....)
> > 
> > So, something I must be doing wrong, any leads ???
> > 
> > (PS: I have ported uIP to a LPC2138 Ethernet board from
> > embeddedartists running with the Keil RTX RTOS, working very 
nicely)
> 
> I too have an LP2148 from embedded artists and I just got the 
usbmem
> example working with gcc to the point that windows recognises my
> board as a mass-storage device with the proper USB device 
descriptors
> (product/vendor id, strings descriptor, etc.)
> 
> USB mass storage itself is not quite working yet, although windows
> properly recognises the size of the disk (at 16 kB).
> 
> I think the relevant steps to make it work were:
> * the P0.31 pin should be configured for the USB 'CONNECT' function
> * aggressive packing of all USB related structs by means of
>   '__attribute ((packed))' and of every 'sub-struct' within those
>   structs.
> * aligning several structures to 32-bit boundaries, using
>   '__attribute ((aligned(4)))'
> * replacing __irq by '__attribute__ ((interrupt))'
> * (I just removed some of the '__at' directives)
> * Modifying the for-loop in USB_ReadEP into
>   for (n = 0; n < (cnt + 3) / 4; n++) {
> 	dw = RX_DATA;
> 	*pData++ = dw >> 0;
> 	*pData++ = dw >> 8;
> 	*pData++ = dw >> 16;
> 	*pData++ = dw >> 24;
>   }
> * Modifying the for-loop in USB_WriteEP into
>   for (n = 0; n < (cnt + 3) / 4; n++) {
>     TX_DATA = (pData[3] << 24) | (pData[2] << 16) | (pData[1] << 
8) |
> pData[0];
>     pData += 4;
>   }
> (there used to be some __packed directive in these parts in the
> Keil code)
> 
> I may have changed some other stuff, but I think the list above
> are the most significant changes.
> 
> Some very useful tools in making it work so far, were:
> * OpenOCD in combination with a wiggler clone and arm-elf-insight.
>   OpenOCD is similar to what OCDRemote does, except this is open-
source
>   http://developer.berlios.de/projects/openocd
> * "usb in a nutshell", a really good document describing the 
essence
Show quoted textHide quoted text
>   of USB, at
>   http://www.beyondlogic.org/usbnutshell/usb-in-a-nutshell.pdf
> * usbsnoop, a windows USB packet sniffer, see:
>   http://benoit.papillault.free.fr/usbsnoop
> 
> Kind regards,
> Bertrik
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (MingW32)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
> 
> iD8DBQFDx/4iETD6mlrWxPURAnaXAJ46r76Yzi/5+YR16aypISUGCIC3fQCgl1HE
> Dss2pAvZbJVHFWL2KAZQevc=
> =XTft
> -----END PGP SIGNATURE-----
>

Re: [lpc2000] Re: LPC2148 USB samples (not working)

2006-01-13 by Bertrik Sikken

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Carsten Gr\ufffdn wrote:
> Thanks for the comments Bertrik !
> 
> I'm currently using Keil and their ULINK JTAG, and the sample from
> their own website USBHID (also tried the USBMEM, same result). I
> _think_ that the hw of the embedded artists board and the keil board
> are more or less the same (P0.23 and P0.31), but still no success.
> The packed "stuff" should be ok (I guess) as they must have it
> running on their own board/using their own compiler.

Before trying to make it work with gcc, I first made it work with
the Keil compiler and my EA board.

To make it work, I needed to:
* Add this line somewhere before USB_Init is called, to set P0.31:
	PINSEL1 = (PINSEL1 & ~(3 << 30)) | (2 << 30);
* Compile all of the code as ARM code, not THUMB (!)
* I also changed some of the LED bits, because the LEDs are at
  different pins on the EA board.

Kind regards,
Bertrik
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDyAENETD6mlrWxPURAj1hAJ0XJLXJ0QP0YGp95FH+P28RtLNSigCfbIqX
nquq4n0XHfxmaKhYSceVVDU=
=vsZ4
-----END PGP SIGNATURE-----

[OT] Supplying LCD Contrast/Drive Voltage

2006-01-13 by Sean

Sorry for the OT post, but I figure that since this is something common to 
embedded projects you guys might have an elegant solution.

I'm looking to create a contrast voltage (typ -13V 10mA) and a LCD Drive 
voltage (min -23V 10mA), onboard I have +5V, +3.3V and Vin which is 
typically +12V.  Ideally the contrast should be digitally controllable.

The big part of the problem: it needs to be relatively cheap.

I've been having a hard time trying to figure out the best way to do 
this.  The best way that I can think of so far is going to be via voltage 
multipliers.  I.e. take 3.3, invert and quadruple to get -13.2V for the 
contrast, and then double again to get -26.4V for the LCD Drive.  I don't 
know however if I can handle 10mA this way after octupling the voltage.

I'm trying to stay away from switched regulators, as they can get expensive.

Thanks for any suggestions that you may have.

-- Sean

Re: LPC2148 USB samples (not working)

2006-01-13 by Carsten Grøn

Yup, the ARM instead of THUMB mode did the trick !!
Wonder why they (keil) releases the project set to THUMB mode ??)

Anyway, the PC now sees two HID devices, "HID-compatible unit" and 
a "USB usercontrolled inputdevice(HID) (names was translated from my 
danish version of Win2K :-)
However, the HIDClient 1 and 2 is not working too well....the 
hidclient1 just hangs when the LPC2148 device is selected, and the 
hidclient2 only partial works, reports some "invalid handles" etc in 
the list view.
Did you get the hidclient1 and 2 programs to work ?

Carsten
Show quoted textHide quoted text
> 
> Before trying to make it work with gcc, I first made it work with
> the Keil compiler and my EA board.
> 
> To make it work, I needed to:
> * Add this line somewhere before USB_Init is called, to set P0.31:
> 	PINSEL1 = (PINSEL1 & ~(3 << 30)) | (2 << 30);
> * Compile all of the code as ARM code, not THUMB (!)
> * I also changed some of the LED bits, because the LEDs are at
>   different pins on the EA board.
> 
> Kind regards,
> Bertrik
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (MingW32)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
> 
> iD8DBQFDyAENETD6mlrWxPURAj1hAJ0XJLXJ0QP0YGp95FH+P28RtLNSigCfbIqX
> nquq4n0XHfxmaKhYSceVVDU=
> =vsZ4
> -----END PGP SIGNATURE-----
>

Re: [lpc2000] Re: LPC2148 USB samples (not working)

2006-01-13 by Bertrik Sikken

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Carsten Gr\ufffdn wrote:
> Yup, the ARM instead of THUMB mode did the trick !!
> Wonder why they (keil) releases the project set to THUMB mode ??)
> 
> Anyway, the PC now sees two HID devices, "HID-compatible unit" and
> a "USB usercontrolled inputdevice(HID) (names was translated from my
> danish version of Win2K :-)
> However, the HIDClient 1 and 2 is not working too well....the
> hidclient1 just hangs when the LPC2148 device is selected, and the
> hidclient2 only partial works, reports some "invalid handles" etc in
> the list view.
> Did you get the hidclient1 and 2 programs to work ?

No, I tried but I didn't get them to work properly.

Bertrik
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDyB7qETD6mlrWxPURApRcAJ9SnejKvAsoFADE4XiEfInvun/QqgCfRgLv
Nb9EUcrhFt7JGTRHc8wTpUY=
=4Ouz
-----END PGP SIGNATURE-----

Re: [lpc2000] [OT] Supplying LCD Contrast/Drive Voltage

2006-01-13 by Onestone

After messing with this one for years I finally went to Winstar and get 
mine on baord for free, however prior to that for digital control I used 
the MAX686, not a cheapest solution but solid, and not too expensive. 
The other cheap way might be to use an MC34063, they are only $1, but no 
digital control, or ON/OFF control without a bit of messing. I used an 
MC14051 ($0.38) and a variety of resistors to get numerous voltage steps.

Cheers

Al

Sean wrote:
Show quoted textHide quoted text
>Sorry for the OT post, but I figure that since this is something common to 
>embedded projects you guys might have an elegant solution.
>
>I'm looking to create a contrast voltage (typ -13V 10mA) and a LCD Drive 
>voltage (min -23V 10mA), onboard I have +5V, +3.3V and Vin which is 
>typically +12V.  Ideally the contrast should be digitally controllable.
>
>The big part of the problem: it needs to be relatively cheap.
>
>I've been having a hard time trying to figure out the best way to do 
>this.  The best way that I can think of so far is going to be via voltage 
>multipliers.  I.e. take 3.3, invert and quadruple to get -13.2V for the 
>contrast, and then double again to get -26.4V for the LCD Drive.  I don't 
>know however if I can handle 10mA this way after octupling the voltage.
>
>I'm trying to stay away from switched regulators, as they can get expensive.
>
>Thanks for any suggestions that you may have.
>
>-- Sean
>
>
>
> 
>Yahoo! Groups Links
>
>
>
> 
>
>
>
>
>  
>

Re: [OT] Supplying LCD Contrast/Drive Voltage

2006-01-13 by bigakisgr

I had the same problem with a seiko lcd screen.
The simplest solution, is to use one of the most common chips on the
market. MAX232 or MAX3232 for 3.3V. It generates -12V.

If you take a look in the datasheet, you will find all the info there.


--- In lpc2000@yahoogroups.com, Onestone <onestone@b...> wrote:
>
> After messing with this one for years I finally went to Winstar and get 
> mine on baord for free, however prior to that for digital control I
used 
> the MAX686, not a cheapest solution but solid, and not too expensive. 
> The other cheap way might be to use an MC34063, they are only $1,
but no 
> digital control, or ON/OFF control without a bit of messing. I used an 
> MC14051 ($0.38) and a variety of resistors to get numerous voltage
steps.
> 
> Cheers
> 
> Al
> 
> Sean wrote:
> 
> >Sorry for the OT post, but I figure that since this is something
common to 
> >embedded projects you guys might have an elegant solution.
> >
> >I'm looking to create a contrast voltage (typ -13V 10mA) and a LCD
Drive 
> >voltage (min -23V 10mA), onboard I have +5V, +3.3V and Vin which is 
> >typically +12V.  Ideally the contrast should be digitally controllable.
> >
> >The big part of the problem: it needs to be relatively cheap.
> >
> >I've been having a hard time trying to figure out the best way to do 
> >this.  The best way that I can think of so far is going to be via
voltage 
> >multipliers.  I.e. take 3.3, invert and quadruple to get -13.2V for
the 
> >contrast, and then double again to get -26.4V for the LCD Drive.  I
don't 
> >know however if I can handle 10mA this way after octupling the voltage.
> >
> >I'm trying to stay away from switched regulators, as they can get
expensive.
Show quoted textHide quoted text
> >
> >Thanks for any suggestions that you may have.
> >
> >-- Sean
> >
> >
> >
> > 
> >Yahoo! Groups Links
> >
> >
> >
> > 
> >
> >
> >
> >
> >  
> >
>

Re: [lpc2000] [OT] Supplying LCD Contrast/Drive Voltage

2006-01-13 by Sean

I am liking the MC34063 idea, it's only $0.50 in 100qty, plus $0.85 for 
supporting components.  Add in a digital pot (i.e. MCP4021 - $0.70) in 
place of the R1 for the comparator circuit (which controls the voltage) and 
you can get a digitally adjustable contrast regulator (64 steps) for about 
$2.  In place of the digital pot you could always use an 8-bit latch (i.e. 
74HC373) with a variety of resistors, that would only be about $0.50 and 
give max 256 levels of control.  In either case, those look like pretty 
good solutions.

Thanks for your input!

-- Sean

At 04:49 PM 1/13/2006, you wrote:
Show quoted textHide quoted text
>After messing with this one for years I finally went to Winstar and get
>mine on baord for free, however prior to that for digital control I used
>the MAX686, not a cheapest solution but solid, and not too expensive.
>The other cheap way might be to use an MC34063, they are only $1, but no
>digital control, or ON/OFF control without a bit of messing. I used an
>MC14051 ($0.38) and a variety of resistors to get numerous voltage steps.
>
>Cheers
>
>Al
>
>Sean wrote:
>
> >Sorry for the OT post, but I figure that since this is something common to
> >embedded projects you guys might have an elegant solution.
> >
> >I'm looking to create a contrast voltage (typ -13V 10mA) and a LCD Drive
> >voltage (min -23V 10mA), onboard I have +5V, +3.3V and Vin which is
> >typically +12V.  Ideally the contrast should be digitally controllable.
> >
> >The big part of the problem: it needs to be relatively cheap.
> >
> >I've been having a hard time trying to figure out the best way to do
> >this.  The best way that I can think of so far is going to be via voltage
> >multipliers.  I.e. take 3.3, invert and quadruple to get -13.2V for the
> >contrast, and then double again to get -26.4V for the LCD Drive.  I don't
> >know however if I can handle 10mA this way after octupling the voltage.
> >
> >I'm trying to stay away from switched regulators, as they can get expensive.
> >
> >Thanks for any suggestions that you may have.
> >
> >-- Sean
> >
> >
> >
> >
> >Yahoo! Groups Links
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
>
>
>
>SPONSORED LINKS
><http://groups.yahoo.com/gads?t=ms&k=Microprocessor&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=tsVC-J9hJ5qyXg0WPR0l6g>Microprocessor 
><http://groups.yahoo.com/gads?t=ms&k=Microcontrollers&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=DvJVNqC_pqRTm8Xq01nxwg>Microcontrollers 
><http://groups.yahoo.com/gads?t=ms&k=Pic+microcontrollers&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=TpkoX4KofDJ7c6LyBvUqVQ>Pic 
>microcontrollers
><http://groups.yahoo.com/gads?t=ms&k=8051+microprocessor&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=1Ipf1Fjfbd_HVIlekkDP-A>8051 
>microprocessor
>
>
>----------
>YAHOO! GROUPS LINKS
>
>    *  Visit your group "<http://groups.yahoo.com/group/lpc2000>lpc2000" 
> on the web.
>    *
>    *  To unsubscribe from this group, send an email to:
>    * 
> <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe>lpc2000-unsubscribe@yahoogroups.com 
>
>    *
>    *  Your use of Yahoo! Groups is subject to the 
> <http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.
>
>
>----------

Re: [lpc2000] [OT] Supplying LCD Contrast/Drive Voltage

2006-01-14 by Onestone

You'reWelcome. When I last did this digital pots were $2-3. I'd look at 
the 573 rather than the 373, it is bussed nicely, 8 inputs on one side, 
8 outputs on the other. I use this all the time, especially the 
SN74LVTH573 in SSOP, about $0.24. It is much cleaner to interface than 
the 373, and this version is 3V3 operating 5V tolerant. The Mc14051 was 
used  in one design becasue I had 1000's of them that needed a good 
home, and it worked well, saving me precious I/O. All of these are good, 
fairly clean solutions, and cheap.

Cheers

Al

Sean wrote:
Show quoted textHide quoted text
>I am liking the MC34063 idea, it's only $0.50 in 100qty, plus $0.85 for 
>supporting components.  Add in a digital pot (i.e. MCP4021 - $0.70) in 
>place of the R1 for the comparator circuit (which controls the voltage) and 
>you can get a digitally adjustable contrast regulator (64 steps) for about 
>$2.  In place of the digital pot you could always use an 8-bit latch (i.e. 
>74HC373) with a variety of resistors, that would only be about $0.50 and 
>give max 256 levels of control.  In either case, those look like pretty 
>good solutions.
>
>Thanks for your input!
>
>-- Sean
>
>At 04:49 PM 1/13/2006, you wrote:
>  
>
>>After messing with this one for years I finally went to Winstar and get
>>mine on baord for free, however prior to that for digital control I used
>>the MAX686, not a cheapest solution but solid, and not too expensive.
>>The other cheap way might be to use an MC34063, they are only $1, but no
>>digital control, or ON/OFF control without a bit of messing. I used an
>>MC14051 ($0.38) and a variety of resistors to get numerous voltage steps.
>>
>>Cheers
>>
>>Al
>>
>>Sean wrote:
>>
>>    
>>
>>>Sorry for the OT post, but I figure that since this is something common to
>>>embedded projects you guys might have an elegant solution.
>>>
>>>I'm looking to create a contrast voltage (typ -13V 10mA) and a LCD Drive
>>>voltage (min -23V 10mA), onboard I have +5V, +3.3V and Vin which is
>>>typically +12V.  Ideally the contrast should be digitally controllable.
>>>
>>>The big part of the problem: it needs to be relatively cheap.
>>>
>>>I've been having a hard time trying to figure out the best way to do
>>>this.  The best way that I can think of so far is going to be via voltage
>>>multipliers.  I.e. take 3.3, invert and quadruple to get -13.2V for the
>>>contrast, and then double again to get -26.4V for the LCD Drive.  I don't
>>>know however if I can handle 10mA this way after octupling the voltage.
>>>
>>>I'm trying to stay away from switched regulators, as they can get expensive.
>>>
>>>Thanks for any suggestions that you may have.
>>>
>>>-- Sean
>>>
>>>
>>>
>>>
>>>Yahoo! Groups Links
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>      
>>>
>>
>>SPONSORED LINKS
>><http://groups.yahoo.com/gads?t=ms&k=Microprocessor&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=tsVC-J9hJ5qyXg0WPR0l6g>Microprocessor 
>><http://groups.yahoo.com/gads?t=ms&k=Microcontrollers&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=DvJVNqC_pqRTm8Xq01nxwg>Microcontrollers 
>><http://groups.yahoo.com/gads?t=ms&k=Pic+microcontrollers&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=TpkoX4KofDJ7c6LyBvUqVQ>Pic 
>>microcontrollers
>><http://groups.yahoo.com/gads?t=ms&k=8051+microprocessor&w1=Microprocessor&w2=Microcontrollers&w3=Pic+microcontrollers&w4=8051+microprocessor&c=4&s=93&.sig=1Ipf1Fjfbd_HVIlekkDP-A>8051 
>>microprocessor
>>
>>
>>----------
>>YAHOO! GROUPS LINKS
>>
>>   *  Visit your group "<http://groups.yahoo.com/group/lpc2000>lpc2000" 
>>on the web.
>>   *
>>   *  To unsubscribe from this group, send an email to:
>>   * 
>><mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe>lpc2000-unsubscribe@yahoogroups.com 
>>
>>   *
>>   *  Your use of Yahoo! Groups is subject to the 
>><http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.
>>
>>
>>----------
>>    
>>
>
>
>
> 
>Yahoo! Groups Links
>
>
>
> 
>
>
>
>
>  
>

Re: [lpc2000] [OT] Supplying LCD Contrast/Drive Voltage

2006-01-14 by Herbert Demmel

Dear Sean,

we had to deal with this issue on our unversal LCD controller boards - see 
at www.demmel.com - and we solved it as follows: We took the (very cheap) 
switcher IC TPS61041, which can produce up to + or -28 volts and made the 
output voltage variable by feeding a PWM controlled voltage of 0...5 (can 
be 0...3.3 volt as well) volt via an 100k resistor to the FB input. You 
only need the TPS61041 which only costs about 1.5 US$ (single pieces) and a 
ready to use Murata 10uH LQH32CN100K33L which costs less than 50 cent 
(price is also for single pieces). You only need a few passive components 
and a shottky diode like MBR0540T1 (about 40 cent) then and everything is 
working fine. You get all parts at www.farnell.com, TI has good reference 
schematics, you only have take care to use X7R capacitors. The TPS61041 can 
be supplied with voltages between 1.8 and 6 volts.

The good thing is, that you can control the voltage with the resolution of 
your PWM and you may save the setting directly in the uP's flash memory.

Hope that helps
Herbert

At 21:26 13.01.2006, you wrote:
>Sorry for the OT post, but I figure that since this is something common to
>embedded projects you guys might have an elegant solution.
>
>I'm looking to create a contrast voltage (typ -13V 10mA) and a LCD Drive
>voltage (min -23V 10mA), onboard I have +5V, +3.3V and Vin which is
>typically +12V.  Ideally the contrast should be digitally controllable.
>
>The big part of the problem: it needs to be relatively cheap.
>
>I've been having a hard time trying to figure out the best way to do
>this.  The best way that I can think of so far is going to be via voltage
>multipliers.  I.e. take 3.3, invert and quadruple to get -13.2V for the
>contrast, and then double again to get -26.4V for the LCD Drive.  I don't
>know however if I can handle 10mA this way after octupling the voltage.
>
>I'm trying to stay away from switched regulators, as they can get expensive.
>
>Thanks for any suggestions that you may have.
>
>-- Sean

----------------------------------------------------------
demmel products
Radnitzkygasse 43
A-1100 Vienna / Austria / Europe
Voice: +43-1-6894700-0
Fax: +43-1-6894700-40
Email: dh@...
WWW: http://www.demmel.com


[Non-text portions of this message have been removed]

Re: LPC2148 USB samples (not working)

2006-01-14 by Carsten Grøn

OK,
are there any "generic" testprograms "out there" that will allow me 
to just test the basic functionality (something like the 
hidclient1), I need nothing fancy, just a way of establishing that 
the HID demo from Keil is basically working in the port I have done ?

Regards,
Carsten


--- In lpc2000@yahoogroups.com, Bertrik Sikken <bertrik@z...> wrote:
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Carsten Grøn wrote:
> > Yup, the ARM instead of THUMB mode did the trick !!
> > Wonder why they (keil) releases the project set to THUMB mode ??)
> > 
> > Anyway, the PC now sees two HID devices, "HID-compatible unit" 
and
> > a "USB usercontrolled inputdevice(HID) (names was translated 
from my
> > danish version of Win2K :-)
> > However, the HIDClient 1 and 2 is not working too well....the
> > hidclient1 just hangs when the LPC2148 device is selected, and 
the
> > hidclient2 only partial works, reports some "invalid handles" 
etc in
Show quoted textHide quoted text
> > the list view.
> > Did you get the hidclient1 and 2 programs to work ?
> 
> No, I tried but I didn't get them to work properly.
> 
> Bertrik
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (MingW32)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
> 
> iD8DBQFDyB7qETD6mlrWxPURApRcAJ9SnejKvAsoFADE4XiEfInvun/QqgCfRgLv
> Nb9EUcrhFt7JGTRHc8wTpUY=
> =4Ouz
> -----END PGP SIGNATURE-----
>

Re: [lpc2000] [OT] Supplying LCD Contrast/Drive Voltage

2006-01-14 by Rob Jansen

Sean,

Herbert's solution looks good.
I did the voltage multiplier stuff (a capacitor/diode network) connected
to a PWM and that does generate the proper voltage for me (around - 4.5V)
but its voltage can not be controlled with pulse width or frequency
change. Voltage does change but there is no way to compute output voltage
using frequency/pulse width.

Rob
Show quoted textHide quoted text
> Dear Sean,
>
> we had to deal with this issue on our unversal LCD controller boards - see
> at www.demmel.com - and we solved it as follows: We took the (very cheap)
> switcher IC TPS61041, which can produce up to + or -28 volts and made the
> output voltage variable by feeding a PWM controlled voltage of 0...5 (can
> be 0...3.3 volt as well) volt via an 100k resistor to the FB input. You
> only need the TPS61041 which only costs about 1.5 US$ (single pieces) and
> a
> ready to use Murata 10uH LQH32CN100K33L which costs less than 50 cent
> (price is also for single pieces). You only need a few passive components
> and a shottky diode like MBR0540T1 (about 40 cent) then and everything is
> working fine. You get all parts at www.farnell.com, TI has good reference
> schematics, you only have take care to use X7R capacitors. The TPS61041
> can
> be supplied with voltages between 1.8 and 6 volts.
>
> The good thing is, that you can control the voltage with the resolution of
> your PWM and you may save the setting directly in the uP's flash memory.
>
> Hope that helps
> Herbert
>
> At 21:26 13.01.2006, you wrote:
>>Sorry for the OT post, but I figure that since this is something common
>> to
>>embedded projects you guys might have an elegant solution.
>>
>>I'm looking to create a contrast voltage (typ -13V 10mA) and a LCD Drive
>>voltage (min -23V 10mA), onboard I have +5V, +3.3V and Vin which is
>>typically +12V.  Ideally the contrast should be digitally controllable.
>>
>>The big part of the problem: it needs to be relatively cheap.
>>
>>I've been having a hard time trying to figure out the best way to do
>>this.  The best way that I can think of so far is going to be via voltage
>>multipliers.  I.e. take 3.3, invert and quadruple to get -13.2V for the
>>contrast, and then double again to get -26.4V for the LCD Drive.  I don't
>>know however if I can handle 10mA this way after octupling the voltage.
>>
>>I'm trying to stay away from switched regulators, as they can get
>> expensive.
>>
>>Thanks for any suggestions that you may have.
>>
>>-- Sean
>

Re: LPC2148 USB samples (not working)

2006-01-14 by Carsten Grøn

Found a few examples, one written in C#, and I have been modifying 
this one to my use, all ok.

I went back to the Philips VCOM example, and changed the code 
generation to ARM instead of THUMB (which it was set to default in the 
project) and now this also works !! I guess there is some error of 
some kind in the Keil toolset I use (vers 2.20), and thats maybe the 
reason behind the problems here....

Regards,
Carsten

--- In lpc2000@yahoogroups.com, Carsten Grøn <cgroen@m...> wrote:
Show quoted textHide quoted text
>
> OK,
> are there any "generic" testprograms "out there" that will allow me 
> to just test the basic functionality (something like the 
> hidclient1), I need nothing fancy, just a way of establishing that 
> the HID demo from Keil is basically working in the port I have done ?
> 
> Regards,
> Carsten
> 
>

Re: [lpc2000] [OT] Supplying LCD Contrast/Drive Voltage

2006-01-14 by Tom Walsh

Herbert Demmel wrote:

>Dear Sean,
>
>we had to deal with this issue on our unversal LCD controller boards - see 
>at www.demmel.com - and we solved it as follows: We took the (very cheap) 
>switcher IC TPS61041, which can produce up to + or -28 volts and made the 
>output voltage variable by feeding a PWM controlled voltage of 0...5 (can 
>be 0...3.3 volt as well) volt via an 100k resistor to the FB input. You 
>only need the TPS61041 which only costs about 1.5 US$ (single pieces) and a 
>ready to use Murata 10uH LQH32CN100K33L which costs less than 50 cent 
>(price is also for single pieces). You only need a few passive components 
>and a shottky diode like MBR0540T1 (about 40 cent) then and everything is 
>working fine. You get all parts at www.farnell.com, TI has good reference 
>schematics, you only have take care to use X7R capacitors. The TPS61041 can 
>be supplied with voltages between 1.8 and 6 volts.
>
>  
>
Interesting technique.  I also was thinking PWM followed by a filter, 
but I was thinking that you would need to switch the  output off/on.  
Your solution to modulate the FB line is a much cleaner one! Cool!

Regards,

TomW



-- 
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------

Re: [lpc2000] [OT] Supplying LCD Contrast/Drive Voltage

2006-01-15 by Sean

Unfortunately the source that I am using for most of my components doesn't 
carry that regulator.  However your idea got me thinking.  From another 
suggestion that was posted, the TPS61041 regulator chip is about 1/2 the 
cost of the TPS61041, provides much higher current, and requires a similar 
number of external components (and has a feedback line).  Would the same 
method of adding a 100k resistor to the feedback line and to a PWM output 
on the micro work here?  I don't see why not.  Can you see anything wrong 
with this idea?

Thanks!

-- Sean

At 06:01 PM 1/14/2006, you wrote:
Show quoted textHide quoted text
>Herbert Demmel wrote:
>
> >Dear Sean,
> >
> >we had to deal with this issue on our unversal LCD controller boards - see
> >at www.demmel.com - and we solved it as follows: We took the (very cheap)
> >switcher IC TPS61041, which can produce up to + or -28 volts and made the
> >output voltage variable by feeding a PWM controlled voltage of 0...5 (can
> >be 0...3.3 volt as well) volt via an 100k resistor to the FB input. You
> >only need the TPS61041 which only costs about 1.5 US$ (single pieces) and a
> >ready to use Murata 10uH LQH32CN100K33L which costs less than 50 cent
> >(price is also for single pieces). You only need a few passive components
> >and a shottky diode like MBR0540T1 (about 40 cent) then and everything is
> >working fine. You get all parts at www.farnell.com, TI has good reference
> >schematics, you only have take care to use X7R capacitors. The TPS61041 can
> >be supplied with voltages between 1.8 and 6 volts.
> >
> >
> >
>Interesting technique.  I also was thinking PWM followed by a filter,
>but I was thinking that you would need to switch the  output off/on.
>Your solution to modulate the FB line is a much cleaner one! Cool!
>
>Regards,
>
>TomW
>
>
>
>--
>Tom Walsh - WN3L - Embedded Systems Consultant
><http://openhardware.net,>http://openhardware.net, http://cyberiansoftware.com
>"Windows? No thanks, I have work to do..."
>----------------------------------------------------
>
>
>
>
>----------
>YAHOO! GROUPS LINKS
>
>    *  Visit your group "<http://groups.yahoo.com/group/lpc2000>lpc2000" 
> on the web.
>    *
>    *  To unsubscribe from this group, send an email to:
>    * 
> <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe>lpc2000-unsubscribe@yahoogroups.com 
>
>    *
>    *  Your use of Yahoo! Groups is subject to the 
> <http://docs.yahoo.com/info/terms/>Yahoo! Terms of Service.
>
>
>----------

Re: [lpc2000] [OT] Supplying LCD Contrast/Drive Voltage

2006-01-15 by Tom Walsh

Sean wrote:

>Unfortunately the source that I am using for most of my components doesn't 
>carry that regulator.  However your idea got me thinking.  From another 
>suggestion that was posted, the TPS61041 regulator chip is about 1/2 the 
>cost of the TPS61041, provides much higher current, and requires a similar 
>number of external components (and has a feedback line).  Would the same 
>method of adding a 100k resistor to the feedback line and to a PWM output 
>on the micro work here?  I don't see why not.  Can you see anything wrong 
>with this idea?
>
>  
>
Pretty much would work.  The idea is to set the feedback such that when 
no external disruption (PWM) signal is present, it will be at the low 
end of the desired range.  Then, when the PWM signal is introduced, it 
sucks (sinks) some current out of the feedback sense line tricking the 
regulator into thinking the output voltage is falling.   The regulator 
then accelerates dumping more current into the output circuit to raise 
the output voltage.

The actual mechanics may be such that you may have to add a small value 
of capacitance into across the feedback pin to filter the effect of the 
PWM rate.  This cap may be needed to steady the output voltage and avoid 
excessive ripple?  I suspect that the capacitor would then act as 
something of an integrator.

The principle is the same for any regulator that uses a resistive 
feedback (or where you can add a resistive divider), you are modifying 
(upsetting) the feedback voltage on a constant basis and the regulator 
will track your disruption.


Regards,

TomW






-- 
Tom Walsh - WN3L - Embedded Systems Consultant
http://openhardware.net, http://cyberiansoftware.com
"Windows? No thanks, I have work to do..."
----------------------------------------------------

RE: [lpc2000] [OT] Supplying LCD Contrast/Drive Voltage

2006-01-15 by Joel Winarske

I believe you are referring to the MC34063A?  If so:

http://www.nomad.ee/micros/mc34063a/index.shtml
This page is nice as it calculates the switch peak current.

In reference to circuit on above page:
Depending on your output voltage, solve output of R1-R2 voltage divider
(input pin 5).  This is the max level you would drive via PWM.  The R1-R2
voltage divider would be omitted in lieu of PWM signal.  Use a voltage
divider on PWM signal to scale for max voltage.  This will prevent undesired
voltages on the MC34063A output.  As Tom mentioned you would want to add
filter to the PWM signal.  And it should be noted when controlling the
MC34063A via PWM, the input voltage must be regulated. 


The MC34063A looks like a nice part for dropping rectified 24VAC down to
3.3VDC.  Thanks for the tip Al.


Joel

Re: LPC2148 USB samples (not working)

2006-02-13 by householder_lpc

Hi,

I noticed your post on the Yahoo LPC2000 forum about porting Keil
LPC2148 Examples to the GNU toolchain on an Embedded Artists board.
I've tried to follow the hints you posted with the USB_HID example,
but without luck. The enumeration process fails....

USBView reports :

bcdUSB:             0x0000
bDeviceClass:         0x00
bDeviceSubClass:      0x00
bDeviceProtocol:      0x00
bMaxPacketSize0:      0x00 (0)
idVendor:           0x0000
idProduct:          0x0000
bcdDevice:          0x0000
iManufacturer:        0x00
iProduct:             0x00
iSerialNumber:        0x00
bNumConfigurations:   0x00

ConnectionStatus: DeviceFailedEnumeration
Current Config Value: 0x00
Device Bus Speed:      Low
Device Address:       0x00
Open Pipes:              0

Can you give any extra infromation/hints on how I should proceed?
Would it please be possible for you to share your code ?

Thanks in advance for your help! 

--- In lpc2000@yahoogroups.com, Bertrik Sikken <bertrik@...> wrote:
Show quoted textHide quoted text
>
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Carsten Grøn wrote:
> > Hello,
> > 
> > I have been playing around with some of the USB samples from Keil
> > etc, and been trying to get just one of them to run on a LPC2148
> > board from www.embeddedartists.com (very nice boards btw) but I'm
> > having some problems. Well, actually it's the sam eproblem no matter
> > which sample I try, I always get a message from Win2K "Unknown
> > device....."....
> > Now, before I bury myself deeeeeep into the "unknown of USB", is
> > there something I need to be aware of when running some of these
> > samples ? The LPC2148 board has P0.31 switching the USB+ to 3V3, and
> > P0.23 senses Vcc from the USB host, which should be the same as the
> > Keil MC2140 board......
> > The same thing happens with the Keil usbmem, usbhid and the philips
> > vcom sample (the keil audio reports an internal linker error when I
> > try to build that....)
> > 
> > So, something I must be doing wrong, any leads ???
> > 
> > (PS: I have ported uIP to a LPC2138 Ethernet board from
> > embeddedartists running with the Keil RTX RTOS, working very nicely)
> 
> I too have an LP2148 from embedded artists and I just got the usbmem
> example working with gcc to the point that windows recognises my
> board as a mass-storage device with the proper USB device descriptors
> (product/vendor id, strings descriptor, etc.)
> 
> USB mass storage itself is not quite working yet, although windows
> properly recognises the size of the disk (at 16 kB).
> 
> I think the relevant steps to make it work were:
> * the P0.31 pin should be configured for the USB 'CONNECT' function
> * aggressive packing of all USB related structs by means of
>   '__attribute ((packed))' and of every 'sub-struct' within those
>   structs.
> * aligning several structures to 32-bit boundaries, using
>   '__attribute ((aligned(4)))'
> * replacing __irq by '__attribute__ ((interrupt))'
> * (I just removed some of the '__at' directives)
> * Modifying the for-loop in USB_ReadEP into
>   for (n = 0; n < (cnt + 3) / 4; n++) {
> 	dw = RX_DATA;
> 	*pData++ = dw >> 0;
> 	*pData++ = dw >> 8;
> 	*pData++ = dw >> 16;
> 	*pData++ = dw >> 24;
>   }
> * Modifying the for-loop in USB_WriteEP into
>   for (n = 0; n < (cnt + 3) / 4; n++) {
>     TX_DATA = (pData[3] << 24) | (pData[2] << 16) | (pData[1] << 8) |
> pData[0];
>     pData += 4;
>   }
> (there used to be some __packed directive in these parts in the
> Keil code)
> 
> I may have changed some other stuff, but I think the list above
> are the most significant changes.
> 
> Some very useful tools in making it work so far, were:
> * OpenOCD in combination with a wiggler clone and arm-elf-insight.
>   OpenOCD is similar to what OCDRemote does, except this is open-source
>   http://developer.berlios.de/projects/openocd
> * "usb in a nutshell", a really good document describing the essence
>   of USB, at
>   http://www.beyondlogic.org/usbnutshell/usb-in-a-nutshell.pdf
> * usbsnoop, a windows USB packet sniffer, see:
>   http://benoit.papillault.free.fr/usbsnoop
> 
> Kind regards,
> Bertrik
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (MingW32)
> Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
> 
> iD8DBQFDx/4iETD6mlrWxPURAnaXAJ46r76Yzi/5+YR16aypISUGCIC3fQCgl1HE
> Dss2pAvZbJVHFWL2KAZQevc=
> =XTft
> -----END PGP SIGNATURE-----
>

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.