hi mark, 100% sure, but i will post the cct. i have not changed brandds but will do that. they are smd and i have some on order from RS. The debug cable is a ribbon cable , with a 10pin box header so no metal shroud. all spare wires are to 0v. ive done some chevking and when the atmega board is off, and the laptop running and plugged in, there is -6v dc from the usb/rs232 converter appeating on the rs242 receiver input of the max, and i suspect this is the culprit, but no proog. a 1k to ground on both rx and tx of the max made no fifference. thanks for taking an interest Mark. Appreciated. neil
Time for a small but perhaps useful contribution. Hope you can make use of it /Per
'********************** STEP MOTOR DRIVING for Arduino Mega2560 and PBL3717 ****************************
This program drives a stepper motor by an interrupt driven background process. One microstep per interrupt A fully autonomous session consist of Ramp_up -> Constant speed for N microsteps -> Ramp_down Any type of 2-phase stepper motor may be used. 4,8,16 or 32 microsteps per physical motor cycle may be specified. This is equivalent to 1,2,4 or 8 microsteps per motor step A stepping sequence can range from -2^31 to +2^31 microsteps (See STEPPER MOTOR PARAMS here below) Each stepping sequence will ramp up and down from a safe start rate, for smoother start/stop It is written for Arduino Mega 2560 interfacing a PBL3717 (NJR3717) or equivalent power IC, but should be rather easy to adapt to other IC's. A simple command line interpreter will accept commands over a serial port
The whole stepping sequence is strated by calling the STEPP routine. It will start background stepping and then return. The Tim1_irq interrupt routine will take care of the actual stepping
SYNTAX: CALL STEPP(<steps> , <rate>) Where <steps> may be -2^31 to +2^31 microsteps and <rate> may be R to XTAL microsteps/sec, but as TIMER1 is just 16 bits long, there is a lower limit to R This lower rate limit is R=XTAL/65535 microsteps/s and is automatically checked by the STEPP routine The upper rate limit is XTAL microsteps/s, but this is of course an unrealistic rate for any motor...
Stepping will automatically wait until previous stepping is finished (or cancelled by user) Stepping will start from a safe rate (S). Then ramp up to final sustained rate (R)
Two PBL3717 ICs are needed. On for each winding. (see attached schematic) The Arduino Mega 2560 interface is like this: Vref_a/b is controlling the amount of power for each microstep via a PWM acting as a DAC (Sine wave approximated power) Phase_a/b is controlling currents direction in the coils during a full microstep sequence Phase_a Alias Portl.0 'Arduino pin 49 Phase_b Alias Portl.1 'Arduino pin 48 I0_a Alias Portl.2 'Arduino pin 47 I0_b Alias Portl.3 'Arduino pin 46 Vref_a Alias Portl.4 'Arduino pin 45 Vref_b Alias Portl.5 'Arduino pin 44 I1_a Alias Portl.6 'Arduino pin 43 I1_b Alias Portl.7 'Arduino pin 42
TCC1 is used for control of the stepping rate TCC5 is used for Motor power control. It acts as a PWM-DAC for the sine wave microstepping
I use 3 Max 202CSE chips on my boards to interface to various external RS232 devices, and for some time have been plagued with intermittent overheating of one MAX device that connects to my debug port. There are various comments of similar problems on other forums, but no real conclusions. My circuit is correct and I have made about 100 of these boards, all of which have been successful (for 5 years) up until now. I have changed my source of the MX202CWE devices - theres a clue.
Anyway - I have found that if I have my laptop with a USB/Ser convertor plugged into my board BEFORE i power up the board, the Max device will latch and burn your fingers. On the other hand, if I plug the USB/ser header in AFTER I power on the PCB, the Max device runs perfectly. I have repeated this test about 10 times, with same result.
I use 0.1uF caps on the charge pumps. Changing these to 1uF polarized made no difference. The 0v of my PCB is connected through the ribbon cable to pin 5 of the USB/ser convertor, so its not a common earth problem. Also - if I run the laptop on battery only, with nothing else plugged into it - that doesnt help. A poster "Prodigy" on this forum also found the same scenario. [quote:d8a065be2a]https://e2e.ti.com/support/interface/rs232/f/392/t/233847[/quote:d8a065be2a] A google search will also uncover many other similar discussions, but no answers yet that i can see.