Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

M2560 I/O?

 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> AVR
View previous topic :: View next topic  
Author Message
KenHorse

Bascom Member



Joined: 16 Jul 2004
Posts: 523

blank.gif
PostPosted: Wed Aug 03, 2011 12:16 am    Post subject: M2560 I/O? Reply with quote

I've got a couple of M2560's that don't seem able to generate a logic high on any I/O pin.

I first noticed the problem when I couldn't communicate serially (via RS232/level shifter) on TxD/RxD. The chip seemed to be ok otherwise (I could program, read and set fusebits, etc) with no problem using ISP. But I noticed that the UART didn't seem to be working (no output from it) so I probed the lines and TxD was sitting low. That is not right.

So for grins, I programed up some of the I/O's to toggle at a 1 sec. rate for testing:

Code:
$regfile = "m2560def.dat"
$crystal = 16000000
$hwstack = 800
$swstack = 600
$framesize = 100
$baud = 57600

Config PORTL.0 = Output
Config PORTL.1 = Output

Do
Print "Hello"
Toggle PORTL.0
Toggle PORTL.1  
Wait 1
Loop

End                                  
 


Not only doesn't the Print work but even the togging of the 2 pins doesn't work either as they stay low and never go high. Yet I can take this code and drop into another M2560 and it works as expected.

I have 2 M2560's behaving badly this way, I have checked for proper VCC and gnd on the appropriate pins and all is good.

Has anyone run into this before and do I simply have a couple of bad 2560s? (these are brand new ones, right out of the rack?)

As these are soldered to a pc board, I really didn't want to replace 'em unless I have no choice.
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Wed Aug 03, 2011 9:56 am    Post subject: Reply with quote

are the fuse bytes set the same?
Check the speed with some other port that does work.

it seems the chip has a bad clock. try external osc.

_________________
Mark
Back to top
View user's profile Visit poster's website
KenHorse

Bascom Member



Joined: 16 Jul 2004
Posts: 523

blank.gif
PostPosted: Wed Aug 03, 2011 3:58 pm    Post subject: Reply with quote

albertsm wrote:
are the fuse bytes set the same?
Check the speed with some other port that does work.

it seems the chip has a bad clock. try external osc.


Fuses are set identically
Using external 16 mHz osc (since I can write and read using ISP, that would confirm the clock is ok, yes? I did 'scope it as well)

Stumped!
Back to top
View user's profile
albertsm

Administrator



Joined: 09 Apr 2004
Posts: 5921
Location: Holland

blank.gif
PostPosted: Wed Aug 03, 2011 4:20 pm    Post subject: Reply with quote

and these chips are not from a sample batch?

i had a problem once with some optical chips, after sending them to the manufacturer, they checked it with a special micro scope and they found many internal wires were not connected.
this was some kind of test series which never should have left the plant. but i bought them from RS components.
Maybe you can send the chips to atmel so they can check it?
I have done batches with m2560 chips and never had a real problem. (all problems were related to the smd assembly of the board).

On the other hand, i have had problems with usb1287 chips. only replacing them solved the problem. could have been the same problem. Some usb chips did not had bootloader loaded too.
i guess with millions of chips, something can go wrong once in a while.

_________________
Mark
Back to top
View user's profile Visit poster's website
KenHorse

Bascom Member



Joined: 16 Jul 2004
Posts: 523

blank.gif
PostPosted: Thu Aug 04, 2011 2:27 am    Post subject: Reply with quote

albertsm wrote:
and these chips are not from a sample batch?

i had a problem once with some optical chips, after sending them to the manufacturer, they checked it with a special micro scope and they found many internal wires were not connected.
this was some kind of test series which never should have left the plant. but i bought them from RS components.
Maybe you can send the chips to atmel so they can check it?
I have done batches with m2560 chips and never had a real problem. (all problems were related to the smd assembly of the board).

On the other hand, i have had problems with usb1287 chips. only replacing them solved the problem. could have been the same problem. Some usb chips did not had bootloader loaded too.
i guess with millions of chips, something can go wrong once in a while.


These are ones from a batch of 100 that has plenty of ones from it that work just fine.

I've manually traced out the path from UART0 to the ST232 to the computer port and everything hardware-wise is perfect.
Oh well, guess I'll yank 'em off the board and try some replacements.
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> AVR All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum