DVK90CAN1 development board & MAX3232

Go To Last Post
11 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all,
I have just started using the DVK90CAN1 & ported some ATMega128 code to it and having some problems.
To solve these, I wrote some code which continuously sens a question mark (0x3f) to UART1m which I want to see using Hyperterminal.
OK, that all that seems straight forward.

When I power up, it sends ?'s for about two seconds and then starts to send gibberish. If I then press reset it stops sending gibberish & about five seconds later it sends more gibberish with the reset still pressed. :o

I have come to the conclusion that the MAX3232 is the culprit. It has about a 1 V P-P charge pump noise on the + & -ve supply. Is this normal?? I have never had any problems like that on MAX232 or MAX232A.

When I reset and hold it reset, the charge on the TXD0 line slowly discharges and then the RS-232 line starts to put out continuous START bit.

I have decoupled the MAX3232 with an extra 1uF Tantalum, but it has had no effect.

Do I have a crook DVK90CAN1 board or crook MAX3232 or is this a common problem.

Lee de Vries

Further test, indicate that I can receive data at all time , by writing data to PORTA LEDS. However except for the first two seconds of power up, echoed data is not responded to by Hyperterminal.

I then used a notebook and I can get more data transfer , but it was marginal & intermittant.

So, I suspect that it is a noise margin problem where the problem is worse because the data transceivers run at +&- 12 V.

Inspecting the data sheet dor the MAX3232 , suggest for a Vcc of +5 Volts C2,C3 & C4 should be 0.33 uF
minimum. So is it a botched design by ATMEL on the DVK90CAN1 board.

Opinions saught. I have another 7 of these boards on order! :(

Lee

Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
Riddle me this...How did the serpent move around before the fall?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are lots of changes between the ATmega128 and AT90CAN128. Take a look at this first:

AVR096: Migrating from ATmega128 to AT90CAN128
http://www.atmel.com/dyn/resourc...

AVR096 wrote:
To be compatible with the new generation of 8-bit AVR microcontrollers (i.e. ATmega169), the register mapping had been remodeled. This new distribution restructures the addressing to improve its coherence and thus to privilege readability.
This alone makes this migration complicated. There are also some bits that were moved to different registers and new register names. An ATmega128 based program might be setting the wrong bits in the wrong registers unless the code has been properly and completely migrated.

I don't remember ever hearing about any generic hardware problem on the DVK90CAN1. My guess is your mega128 migration isn't complete.

Maybe try some of this CAN library software?
http://www.atmel.com/dyn/resourc...

The ATDVK90CAN1 Hardware User Guide said there is a CD ROM with software and there is an AVR assembly basic test program listed in section 4.
http://www.atmel.com/dyn/resourc...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

BTW, I don't know what Hyperterminal does with questionable (pun intended) characters, but perhaps '?' is a bad choice. 'U' continuously is better as at 8,n,1 it ends up to be a square wave output.

Does ??? indicate a break condition--continuous start bits? Yes, certainly TXD0 on any AVR is going to drift low when held in reset if there is any drain on it at all to pull it low, and the transceiver is then going to output >>some<< continuous level.

Do the AVR init and

while (1) {putchar('U');}

as the only "program" besides a simple polled putchar() that waits for UDRE. What happens then? What does a 'scope trace show? The bit widths can be used to verify AVR clock speed (or even a frequency counter on your meter).

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The above made me think--the world's smallest AVR clock speed + USART test program:

#include 
void main (void)
{
UCSR0B = 1<<TXEN0;
UBRR0L = nn; // optional; see below

while (UCSR0A & (1<<UDRE0)) UDR0 = 'U'
}

That is even shorter than the shortest CTC program to an output pin of clk/2. ('Cause less register manipulations and you don't have to make the pin an output.)

UBRR is "optional" as one can predict what baud rate UBRR of 0 will give, if the AVR clock rate is what you think it is. And if it isn't the 'scope or frequency meter can measure the 'U' and scale it just as easily as measuring the CTC output.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Mike & Theusch,
Thanks for your suggestions.
1. I expected some changes, but the USART code is pretty well the same. However thanks for the tip not to assume to many things.

2. The test program does not use the serial port unfortunatily, however, it is starting to look more like the low value caps on the MAX3232. I am hoping to shunt them today, but they are tiny & the place to work in is very small and my fingers are too fat and whilst I have a really nice soldering station my eyes start playing up after 30 seconds of staring at a board. I think I need to employ an apprentice. What!
A y generation, with his headphones playing loud music all the time whilst he is texting hid girl friend all day. Maybe I had better give up electronics after 45 years ...hi hi!

3. Yes, Nice tests routine. I like it! I generally use 'U' as well, when I observe things with a CRO. and I also like to use '?', to see which way up the signals are.

4. The scope by the way does on screen display of frequency & period etc. and the code is OK. It is purely a matter that the MAX232 , seems to run out of steam after about two seconds. ( which I a still having trouble coming to terms with as the MAX232 have never given me a problem before & I have used 1000's of them).

Regards,

Lee de Vries

Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
Riddle me this...How did the serpent move around before the fall?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

According to the STK501 schematic, it uses the MAX3232ECAE with four type X7R, 16 volt at 100 nf capacitors. This appears to be the same values and configuration as the DVK90CAN1 schematic. I have used the STK501 RS232 with Bray's terminal for years without any problem at all. I think you are off on wild goose chase with the capacitor values.

Have you double checked the J5 connections and the RS232 cabling to the computer. I don't know if the computer cable needs a DB-9 modem pin configuration or if it needs a DB-9 reverse modem (also called a cross over cable) cable pin configuration. I always just used the ATMEL supplied cable to connect to the PC DB-9 without any problems, so I never did figure out which type of cable it was.

If a jumper or cabling problem is connecting two competing RS232 output pins together, I would expect the voltage level to do strange things.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

2. The test program does not use the serial port unfortunatily,

??? Didn't I just post one that should completely test it (well, the TX part) without the interference of any real application?

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Looking a little deeper I just noticed the DB-9 RS232 cable connector on the STK501 is wired differently than the DVK90CAN1 DB-9 RS232 connector in the schematics. The CTS and RTS input/output connections on the MAX3232 are reversed. The TXD and RXD are the same.

Now I remember the correct name for that reversed RS232 DB-9 computer cable. Its called a null modem cable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

theusch wrote:
Quote:

2. The test program does not use the serial port unfortunatily,

??? Didn't I just post one that should completely test it (well, the TX part) without the interference of any real application?

Lee

Sorry confusion reigns. I was referring to the AVR supplied test program which Mike referrred to.

Your suggested program, works fine for two seconds.

I have done some further tests however.

By shunting the existing caps, with 1uF Tants. I can get rid of the ripple completely.

With the terminal programs that I normally use, the terminal in BLIPS( which I generally use for bootloading) & Hyperterminal , the "U's" are only displayed for about two seconds. However, when I use Br@ys it works OK, but does a hiccup every now and then.

I am wondering if Br@ys does a better job of recovering from framing/overun errors then what other
simpler terminal programs do?

I suspect the MAX3232, as I don't think the voltages on the MAX3232 caps look right & will compare them with a MAX202 in another project.

So at least I have a solution that works. AVRJTAG mk2 & Br@ys. However, I will see what happens when I get the other seven units that I have on order in which I want to install bootloaders.

Thanks for your help & support!

Lee

Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
Riddle me this...How did the serpent move around before the fall?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just speculation, but it kind of sounds like you have the wrong AVR clock. Either the wrong clock source jumpers or the AVR clock select fuses are not set correctly. For example; unstable RS232 behavior is typical of running a USART from the internal RC oscillator which is not accurate or stable enough for consistent operation. Just a guess?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Mike,
Wish it was. No it is running of a 8 Mhz. rock & the fuses are set correct.
With Br@ys it runs perfectly now that I have increased caps to 0.57uF (0.1//0.47). With most other terminals programs it plays up after two seconds still. I didi think it was the WDT (which has a 2.1 second time out,
but I write the WDT status register out to PORTA continuosly and that always stays at 0x00.

I will now wait till I get the rest of them to see what the common factor is. My money is on the MAX3232 now!

Lee

Charles Darwin, Lord Kelvin & Murphy are always lurking about!
Lee -.-
Riddle me this...How did the serpent move around before the fall?