Reply by power_overwhelming_4 October 13, 20042004-10-13

I've tried both suggestions in this dual PWM thing. I did what Tom
said which is to initialize pin 26 in the BX IDE (Project menu ->
Chip) as low output, but nothing changed. Only pin 27 has pulse
trains from PWM and pin 26 still has none.

I also tried Chuck's suggestion to "hack" the chip by cutting pin 26
from the green led, anyway, i only disconnected the green led from
the pin. I expected p26 will work now afterwards, but still it
doesn't!!

I also tried to tap from the AT908535 pins directly. I also
discovered that the Atmel datasheet also fed us with wrong
information on the pinouts of OC1A and OC1B. Anyways, i eventually
found the correct OC1A and OC1B pins from the Atmel chip and its
position is very different from the specified in the datasheet.
Using ohmmeter, i tested the OC1A and OC1B pins if they are indeed
connected to the header pins, and they are. The OC1B pin (in 27) in
Atmel chip is working, but OC1A is not working. It's strange since
just last month the PWM pin 26 is working. Are there any more
suggestions on how to remedy this problem? Do i really need to buy
a new BX24 chip? The dual PWM is really critical. Help!!!



Reply by Edson Gano October 13, 20042004-10-13

So what basically is the solution? We tested the BX24
over and over with the LEDexample and PWM example
program and it registered inconsistent results.
LEDexample shows pulses from pin26 whenever it is set
to high, so the pin can output. But PWMexample says
otherwise, no pulse trains appearing on the pins. We
concluded that the pwm functionality of the chiip is
in question. Is there any diagnostic program anyone
could suggest that could determine the problem?

ALso i ran the PWMexample program, then i tried to
short pin26 to pin27, the green led began to blink. So
i think there is no problem with the connection
between pin 26 and the green led. Am I still making
sense =)?
_______________________________



Reply by Chuck October 13, 20042004-10-13
Classically educated?

No, not really. I was thinking about electron flow and typing at
the same time. The point is, your circuit was sinking voltage and
mine was sourcing voltage. In you circuit, current, in the
conventional thinking, flows from VCC through the pullup resistor,
thru the LED to GND. At the same time current flows from VCC
thru your CMOS component to the same GND. Good results. In my circuit,
current flowed from the LED and the BX24 into the op-amp's GND.
Two sources thru the same component distorted the expected results.
I had to cut the LED free to allow only the BX24 output to source
voltage to the op-amp. Again, this is something we all need to think
about when connecting external devices to any microcontroller.
Look for the unexpected consequences of that connection.

Chuck




Reply by Tom Becker October 13, 20042004-10-13
> ... current flowed from P26 equally through the LED and the HC
component...

No, that's incorrect, Chuck. The CMOS input is essentially a voltage
input; it draws and supplies little practical current. When the BX-24
output pin is pulled to ground by the processor the voltage on the pin
drops to zero; that's what the CMOS logic sees. As it happens,
simultaneously, current is drawn through the green LED via its series
resistance from Vcc; because the current required by the LED is not
large, it's effect on the output pin voltage is small.

Chuck, your view of current flow is classically correct, I believe;
electrons move from negative toward positive supplies. Conventional
current flow, though, is usually viewed as the opposite, from positive
toward negative supplies. Are you classically educated? Tom
Tom Becker
--... ...--
www.RighTime.com
The RighTime Clock Company, Inc., Cape Coral, Florida USA
+1239 540 5700



Reply by Chuck October 13, 20042004-10-13
Tom,

In using HC logic, you sink the inputs to GND to drive the component.
With the op-amp I was using I had to source the input, thus allowing current
from
the op-amp's input through the LED to VCC. This is what was distorting the
output of the op-amp. By sinking the input, current flowed from P26 equally
through the LED and the HC component, which eliminated any distortion.
Interesting stuff!!! Good lesson for everyone!

Chuck



Reply by Tom Becker October 13, 20042004-10-13
I just loaded and ran the BX-24 PWM example. I started, I'm certain,
with this code but mine looks nothing like it now. Still, the example
code runs fine and it does, as you point out, set the pins to low output
initially. My suggestion to make them inputs will not help.

FWIW, it is possible to see the PWM on both pins without a scope by -
making sure pin 25 is an input - jumpering pins 25 and 27. If the demo
does not exercise both LEDs in that configuration, something is wrong
with the module. If both LEDs do cycle through the 10-second loop, the
module is probably fine. Tom
Tom Becker
--... ...--
www.RighTime.com
The RighTime Clock Company, Inc., Cape Coral, Florida USA
+1239 540 5700


Reply by Tom Becker October 13, 20042004-10-13
> ... I'd love to see the circuit you have tied to P26...

Pins 26 and 27 feed simple HCMOS gates in my stuff. They are inputs, of
course, which draw essentially no current in either state. The only
path that will pull the green LED cathode to ground - in my projects -
is the BX-24 pin 26 driver, in the 8535. That driver will easily pull
the pin to ground, whether the green LED cathode is connected to it or
not. Tom
Tom Becker
--... ...--
www.RighTime.com
The RighTime Clock Company, Inc., Cape Coral, Florida USA
+1239 540 5700



Reply by Chuck October 13, 20042004-10-13
Tom,

I'd love to see the circuit you have tied to P26. I studied and tested for
several days
before I discovered that any circuit, that eventually went to GND, caused
current to
flow through the green LED. Cutting the run was the only solution. Also, in
the PWM
example program, both PinOC1A and PinOC1B are set to bxOutputLow. Did you
use the PWM example program or some other code?

Chuck ----- Original Message -----
From: "Tom Becker" <>
To: <>
Sent: Wednesday, October 13, 2004 8:25 AM
Subject: RE: [BasicX] PWM Hardware problem???!!! >
>> ... Simply cut the copper trace...
>
> I have two dual-PWM BX-24 projects running on the bench. I've done two
> others in the last few years that also use dual-PWM from the BX-24.
> I've never cut a run on the module, and I suggest that you do not do so. > Tom >
> Tom Becker
> --... ...--
> www.RighTime.com
> The RighTime Clock Company, Inc., Cape Coral, Florida USA
> +1239 540 5700 > Yahoo! Groups Links





Reply by Tom Becker October 13, 20042004-10-13
> ... no pulse trains appear. Only 4-5 VDC...

Try setting pins 26 and 27 to Input, either in the IDE (Project/Chip) or
using PutPin in your code before initializing PWM mode. Perhaps you
have pin 26 set as a high output. Tom
Tom Becker
--... ...--
www.RighTime.com
The RighTime Clock Company, Inc., Cape Coral, Florida USA
+1239 540 5700


Reply by Tom Becker October 13, 20042004-10-13
> ... Simply cut the copper trace...

I have two dual-PWM BX-24 projects running on the bench. I've done two
others in the last few years that also use dual-PWM from the BX-24.
I've never cut a run on the module, and I suggest that you do not do so. Tom
Tom Becker
--... ...--
www.RighTime.com
The RighTime Clock Company, Inc., Cape Coral, Florida USA
+1239 540 5700