the 328n is driving me crazy

Discussion about the ZBasic language including the System Library. If you're not sure where to post your message, do it here. However, do not make test posts here; that's the purpose of the Sandbox.
Post Reply
rdrive
Posts: 17
Joined: 03 December 2010, 22:31 PM

the 328n is driving me crazy

Post by rdrive »

I have over 15 328n's and it looks like they are all bad. I have built the program board 3 times and checked every connection many times. I have had the 328n and program boards built. and they work but only once or twice. I put a new one in and it comes up and says HI then I program it and it works good for about 2 times and then it starts not verifying after programing and strange characters start appearing. I have used the zx-24 with the same program and everything fine. It's like the 328n is to sensitive. This last one it came up and programed and verified. then I changed one bit on the program and it programmed but won't verify and I never moved it . My voltage comes from my PC into a 7805 which outputs about 4.8v. I will send these in as you suggested and I appreciate it if you look at them. I haven't because I keep buying more hoping it will be me. Now I'm going to be late on a contract with 15 bad 328n's. Is there something else to look at or can I re-flash these things or what? please advise
twesthoff
Posts: 247
Joined: 17 March 2006, 6:45 AM
Location: Fredericksburg, VA

the 328n is driving me crazy

Post by twesthoff »

If you would show us your circuit/schematic we could look at it.  Maybe  fresh eyes will see something you don't.

If a 7805 is putting out 4.8V that suggests something is wrong.  What/how are you connecting the 7805 to your PC? Is the 7805 warm?

On 3/3/2014 4:17 AM, ZBasic wrote:
I have over 15 328n's and it looks like they are all bad. I have built the program board 3 times and checked every connection many times. I have had the 328n and program boards built. and they work but only once or twice. I put a new one in and it comes up and says HI then I program it and it works good for about 2 times and then it starts not verifying after programing and strange characters start appearing. I have used the zx-24 with the same program and everything fine. It's like the 328n is to sensitive. This last one it came up and programed and verified. then I changed one bit on the program and it programmed but won't verify and I never moved it . My voltage comes from my PC into a 7805 which outputs about 4.8v. I will send these in as you suggested and I appreciate it if you look at them. I haven't because I keep buying more hoping it will be me. Now I'm going to be late on a contract with 15 bad 328n's. Is there something else to look at or can I re-flash these things or what? please advise



dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: the 328n is driving me crazy

Post by dkinzer »

rdrive wrote:I will send these in as you suggested and I appreciate it if you look at them.
You're welcome to also send one of your application boards. I'd be willing to spend some time looking at it but only if I also have schematics and some clear metrics for determining whether it's working or not.
- Don Kinzer
GTBecker
Posts: 616
Joined: 17 January 2006, 19:59 PM
Location: Cape Coral

Post by GTBecker »

> ... My voltage comes from my PC into a 7805...

What voltage from the PC are you using? 12V or 5V? The 12V supply is fine for a 7805 - but 5V, like from a USB port, is not.

Have you tried an alternative supply?
Tom
rdrive
Posts: 17
Joined: 03 December 2010, 22:31 PM

328n's

Post by rdrive »

Thank you for your quick responses I will send you the circuit tonight and I used the 12 volts from the PC to regulate down to 5 volts.
GTBecker
Posts: 616
Joined: 17 January 2006, 19:59 PM
Location: Cape Coral

Re: 328n's

Post by GTBecker »

If a 7805 is putting out 4.8V that suggests something is wrong...
I agree. That suggests you're drawing a lot of current - which should make the 7805 hot unless it's massively heatsunk. If you remove the 328n (is it socketed?), and other active devices, what happens to the 7805 output?
Tom
rdrive
Posts: 17
Joined: 03 December 2010, 22:31 PM

Post by rdrive »

there is no heat sink but I never noticed it being to hot but now i don't have a running program to test. I'm attaching the ckt . not sure how
Attachments
motcont1.pdf
(386.1 KiB) Downloaded 367 times
twesthoff
Posts: 247
Joined: 17 March 2006, 6:45 AM
Location: Fredericksburg, VA

Post by twesthoff »

I will study you circuit more later, but took a quick look.

What are the values of the two capacitors on either side of the 7805?
How much current does the motor take at each of the three speeds?

My guess is that the motor emf/spikes may be causing problems with the processor.
If you disconnect the motor from the circuit, will it program the chip?

A 0.1uf or larger capacitor across the motor may help, and a protection diode at the output of the regulator (cathode to +, anode to -) would be a good idea.

The 328n should also be isolated/filtered from the 5V since it shares the same supply as the motor. Something similar to the way the AVCC pin is filtered, but with different part values.

Tom W
GTBecker
Posts: 616
Joined: 17 January 2006, 19:59 PM
Location: Cape Coral

Post by GTBecker »

A few observations:
- Motor powered from logic supply. Better powered from separate 5V - or 12V.
- Motor spike protection diode (can't be across reversable motor, so across high-speed FET).
- Reversing relay coil draws less than 20mA?

Also a few suggestions:
- PWM for speed (and direction) control.
- AVcc inductor necessary if no ADC use?
Tom
twesthoff
Posts: 247
Joined: 17 March 2006, 6:45 AM
Location: Fredericksburg, VA

Post by twesthoff »

From what you said, you have already made your circuit boards. Maybe these extra parts could be added to your board with not too much trouble.

Pardon my crude way of editing your circuit...
Attached is one way you could improve your circuit and probably stop blowing up the chips. Others may have additional ideas. Knowing the values of the capacitors and the part number of the relay would help too.

Let us know how it works or if you have any more questions.

Tom W
Attachments
motcont2.pdf
(197.64 KiB) Downloaded 378 times
rdrive
Posts: 17
Joined: 03 December 2010, 22:31 PM

328n

Post by rdrive »

although the motor was disconnected when I was having problems. All your suggestions are very correct. I will separate the voltage from CPU, heat sink the motor reg. add protection diodes. and modify the board to accommodate. These are all sound things I will do. Unfortunately the only thing operating was the 328n's but I will do all these things and order more 328's and I'll let you know how it turns out .
Thank you all
cerickson
Posts: 45
Joined: 20 May 2008, 15:50 PM
Location: Waikoloa Village, HI, USA
Contact:

Post by cerickson »

There is also the possibility that there is an error on the circuit boards that does not show in the logical schematic.
twesthoff
Posts: 247
Joined: 17 March 2006, 6:45 AM
Location: Fredericksburg, VA

the 328n is driving me crazy

Post by twesthoff »

The only other thing I question is the current the relay coil uses.  It could be overloading the 328n's output pin. Maybe a transistor should be used to drive the relay coil.

On 3/5/2014 4:37 AM, ZBasic wrote:
although the motor was disconnected when I was having problems. All your suggestions are very correct. I will separate the voltage from CPU, heat sink the motor reg. add protection diodes. and modify the board to accommodate. These are all sound things I will do. Unfortunately the only thing operating was the 328n's but I will do all these things and order more 328's and I'll let you know how it turns out .
Thank you all



DocJC
Posts: 112
Joined: 16 March 2006, 6:23 AM
Location: Cleveland, OH
Contact:

Post by DocJC »

Also, I did not see the number for the switching transistors.

One assumes they are logic level devices and switch fully on with the logic level gate signal, and that they can handle the STALL current of the motor, not just the running current, with an ample safety factor.

JC
DocJC
Posts: 112
Joined: 16 March 2006, 6:23 AM
Location: Cleveland, OH
Contact:

Post by DocJC »

Also, is there a By-Pass capacitor from V+ to Ground, as close to the micro's pins as possible, (e.g. 0.1 uF)?

This is required for reliable operation, especially in a noisy motor control circuit.

Also, check you specific crystal's spec's. 27 pf might be a bit high for many crystals, especially if one factors in some capacitance for the PCB layout traces. If the Xtal / Clock isn't running, the chip will appear "dead".

JC
Post Reply