Forum - MCS Electronics

 

FAQFAQ SearchSearch RegisterRegister Log inLog in

AVR-DOS, HDD and ATmega2560 Problems
Goto page 1, 2  Next
 
Post new topic   Reply to topic    www.mcselec.com Forum Index -> AVR-DOS
View previous topic :: View next topic  
Author Message
mariom79

Bascom Member



Joined: 11 Oct 2004
Posts: 48
Location: Faenza (RA) - ITALY

italy.gif
PostPosted: Thu Oct 23, 2008 5:26 pm    Post subject: AVR-DOS, HDD and ATmega2560 Problems Reply with quote

Hi guys, I have a lot of problems with AVR-DOS and ATmega2560. I have tried to connect an HDD to ATmega2560, but i get an error during the driveinit sequence, I have also tried with sample supplied with bascom, but nothing to do. If I use the sample with ATmega128, all working with no problem. I have used the standard ports (A,C,B) in both case. There are some tips to get working the HDD and AVR-DOS with new ATmega2560 ???

Many thanks in advance for any suggestion or help.
Best Regards.
Back to top
View user's profile MSN Messenger
mariom79

Bascom Member



Joined: 11 Oct 2004
Posts: 48
Location: Faenza (RA) - ITALY

italy.gif
PostPosted: Tue Oct 28, 2008 11:43 am    Post subject: Reply with quote

....no suggestions ??? ....there is no way to get it working ?
Back to top
View user's profile MSN Messenger
mariom79

Bascom Member



Joined: 11 Oct 2004
Posts: 48
Location: Faenza (RA) - ITALY

italy.gif
PostPosted: Sun Nov 16, 2008 12:08 pm    Post subject: Reply with quote

Hi again, I have made another test in order to understand where is the problem, AVR-DOS and ATmega2560 works perfectly with SD-CARD in SPI, but don't work with CF/HDD, the error returned with CF/HDD is 227 on driveinit(). So I think that the problem is with CF/HDD driver ...some timing or port register addressing ....I don't know I'm not an ASM developer. I hope that these tests are a good way for solve the issue.
Back to top
View user's profile MSN Messenger
mariom79

Bascom Member



Joined: 11 Oct 2004
Posts: 48
Location: Faenza (RA) - ITALY

italy.gif
PostPosted: Wed Feb 11, 2009 12:38 pm    Post subject: Reply with quote

up up. Confused
Back to top
View user's profile MSN Messenger
oe9vfj

Moderator



Joined: 17 Jun 2004
Posts: 269
Location: Austria, Hard

austria.gif
PostPosted: Wed Feb 11, 2009 3:27 pm    Post subject: Reply with quote

On which ports do you attached the CF/HDD device.
Can you send me a schematic and the your CONFIG_HardDisk.bas file.

_________________
regards Josef

DOS - File System for BASCOM-AVR on http://members.aon.at/voegel
Back to top
View user's profile Visit poster's website
mariom79

Bascom Member



Joined: 11 Oct 2004
Posts: 48
Location: Faenza (RA) - ITALY

italy.gif
PostPosted: Wed Feb 11, 2009 6:46 pm    Post subject: Reply with quote

oe9vfj wrote:
On which ports do you attached the CF/HDD device.
Can you send me a schematic and the your CONFIG_HardDisk.bas file.


Hi, for the tests I have used the sample programs supplied with bascom, I have tried with all combination of ports.

In my application I have tried with PortA = IDEH, PortC = IDEL, PortD = IDECTRL.

In both case with the same problems. With ATmega128 this settings work fine.

Many thanks for your help.
Back to top
View user's profile MSN Messenger
mariom79

Bascom Member



Joined: 11 Oct 2004
Posts: 48
Location: Faenza (RA) - ITALY

italy.gif
PostPosted: Thu Feb 12, 2009 8:51 am    Post subject: Reply with quote

Hi Again, the problem is the same with ATmega 1280/1281. I think that the problem is in low level driver that interface with HDD/CF. If you want I can make all tests that you want.

Best Regards.
Back to top
View user's profile MSN Messenger
oe9vfj

Moderator



Joined: 17 Jun 2004
Posts: 269
Location: Austria, Hard

austria.gif
PostPosted: Thu Feb 12, 2009 11:02 am    Post subject: Reply with quote

Please check your XRAM configuration in Option/Compiler/Chip. No XRAM should be enabled in this Option or anywhere in the Code, because this configuration affects Port-A and Port-C.

Do you use HW-TWI. This also affect the Port-D.

_________________
regards Josef

DOS - File System for BASCOM-AVR on http://members.aon.at/voegel
Back to top
View user's profile Visit poster's website
mariom79

Bascom Member



Joined: 11 Oct 2004
Posts: 48
Location: Faenza (RA) - ITALY

italy.gif
PostPosted: Thu Feb 12, 2009 11:08 am    Post subject: Reply with quote

Hi, the XRAM is disabled in any case, and I don't use HW-TWI or I2C. The same software compiled for ATM128 works fine, compiled for ATMEGA1281 (that is pinout compatible) don't work. I use STK501 with ATM128/1281/2561 and STK503 with ATM1280/2560 with the same wire and connections.
Back to top
View user's profile MSN Messenger
mariom79

Bascom Member



Joined: 11 Oct 2004
Posts: 48
Location: Faenza (RA) - ITALY

italy.gif
PostPosted: Mon Feb 16, 2009 2:23 pm    Post subject: Reply with quote

Hi, do you have find something about these problems ? Can I make some tests ?

Best Regards.
Back to top
View user's profile MSN Messenger
bzijlstra

Bascom Ambassador



Joined: 30 Dec 2004
Posts: 1179
Location: Tilburg - Netherlands

netherlands.gif
PostPosted: Mon Feb 16, 2009 7:59 pm    Post subject: low level routines... Reply with quote

There are some low level harddisk routine for an Atmega128 on my homepage. Written 5 years ago...

http://members.home.nl/bzijlstra/software/examples/ata_harddisk.bas.txt

Perhaps you can find somewhere on the internet the hardware from www.edtp.com

Have fun
Ben Zijlstra
Back to top
View user's profile Visit poster's website
oe9vfj

Moderator



Joined: 17 Jun 2004
Posts: 269
Location: Austria, Hard

austria.gif
PostPosted: Tue Feb 17, 2009 7:38 am    Post subject: Reply with quote

After you started with the AVR-DOS Test-Program (FS_Interpreter) try to read the sector 0 with SD 0. If a sector is shown please post the dump.
_________________
regards Josef

DOS - File System for BASCOM-AVR on http://members.aon.at/voegel
Back to top
View user's profile Visit poster's website
mariom79

Bascom Member



Joined: 11 Oct 2004
Posts: 48
Location: Faenza (RA) - ITALY

italy.gif
PostPosted: Tue Feb 17, 2009 8:24 pm    Post subject: Reply with quote

Hi, the result of the test (ATmega1281) is:

---------------------------------
Wait for Drive
Error during Drive Init: 227
AVR-DOS: Ready for commands

0000>sd 0
Dump Sectors from 0 to 0
Read Sector: 0 ... Error 227 at sector# 0
Drive Error: 227
Drive Status:00000000
Drive Debug: 0

0000>
----------------------------------

I have used PORTA, PORTC, PORTC with "Test_DOS_Drive.bas" supplied with BASCOM.
The hardware, board, wire, crystal, are the same with working ATmega128.
The result is the same with ATmega2560 / Atmega 2561 / ATmega1280.

Best Regards.
Back to top
View user's profile MSN Messenger
oe9vfj

Moderator



Joined: 17 Jun 2004
Posts: 269
Location: Austria, Hard

austria.gif
PostPosted: Wed Feb 18, 2009 3:26 pm    Post subject: Reply with quote

I checked the generated code for an ATMega1281, which interacts with the HD and found no difference to ATMega128. The Atmel Application Note AVR097 (Migration between ATMega128 and ATMega1281/ATMega2561) has no information which brings light to this topic.
I have no board with such ATMega types to test it on hardware. At the moment I have no idea, what could be the cause of your problem.

I am thinking about to buy a development-board to check new (high-end) AVR-Types with AVR-DOS. I am just checking, whether the STK600 with adapter-boards will be better than STK500 with STK501 and STK503. But the Information provided by ATMEL (schematic ) is very rare.
What is your opinion. Do you know a good (and cheap) distributor in EU for such boards.

best regards

_________________
regards Josef

DOS - File System for BASCOM-AVR on http://members.aon.at/voegel
Back to top
View user's profile Visit poster's website
mariom79

Bascom Member



Joined: 11 Oct 2004
Posts: 48
Location: Faenza (RA) - ITALY

italy.gif
PostPosted: Wed Feb 18, 2009 4:03 pm    Post subject: Reply with quote

Hi, the ATmega1281 and ATmega2561 are pinout compatible with ATmega128, and you could use STK500+STK501 to program these chips. (I have made all tests with STK500+501). I have bought the bord from DIGIKEY, but you can find it also from FARNELL (www.farnell.com).
I don't know because with the same code the program don't work with new chips. Maybe the problems are around the port register. For example with PORTE and PORTF you can't use GLCD because these ports are in extended memory space. I don't know if these problems are the same.

Best Regards.
Back to top
View user's profile MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    www.mcselec.com Forum Index -> AVR-DOS All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
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