4

I'm going to start a new project and I wonder if the concept makes sense. (I'm not so familiar with ATA specifications to answer this by myself :))

The concept:

HW design:

"SATA connector on motherboard" <-> "SATA cable" <-> "SATA/IDE HW converter" <-> "ATMEGA168"

  • "SATA connector on motherboard" <-> "SATA cable" - Device would be connected to SATA port on PC motherboard with typical SATA cable

  • "SATA/IDE HW converter" - on my PCB I will use one of SATA/IDE controllers, so far I've found: JMicron - JM20330,
    Atmel - AT78C5010,
    ACARD - ARC-770

  • "ATMEGA168" - as programmable unit I'd like to use ATmega168 (or any other cheap 8-bit microcontroller)

Purpose

With this device I'd like to simulate presence of hard drive in a system. As I want SATA/SCSI stack to be used by OS I need to use SATA ports on motherboard. AFAIK connecting to SATA interface without SATA/IDE converter is impossible with ATMega microcontrollers due to big speed of SATA bus interface. Nevertheless I've found IDE/ATA implementation for 8-bit uC: http://www.opend.co.za/hardware/avride/avride.htm

Wonders

My biggest concern is the SATA/IDE converter, I wonder if it can be easly used with micro-controllers as ATMega?

Brian Carlton
  • 13,252
  • 5
  • 43
  • 64
usecide
  • 93
  • 1
  • 5

1 Answers1

5

Wow, I would've expected the 133MHz ATA/IDE interface would be too fast for an ATmega chip, but it looks like they use it in ATA33 (33MHz) mode, somehow getting it to work with a 4MHz(!) ATmega32.

In this case you shouldn't have any problems with a SATA to IDE converter, since they're designed to support older ATA33 devices.

Note however that the OS SCSI stack is only used for SATA devices. IDE uses a different command set, so you won't see SCSI commands arriving at your ATmega, if that's your intention. (The host PC will certainly issue SCSI commands though, and the SATA to IDE device will translate.)

An alternative that might be easier to achieve is to use a USB interface chip to make your ATmega appear as a USB hard drive. AFAIK this does use the SCSI protocol (perhaps a limited subset of it though), so you would see SCSI commands arriving on your device. Recent PCs can boot off a USB hard drive too, if that's your need for connecting directly to SATA.

This solution would be much less sensitive to timing too, as the USB chip would talk over the USB bus at the correct speeds, allowing you to talk to the chip at whatever speed you can manage.

Malvineous
  • 1,649
  • 1
  • 15
  • 27
  • IDE can run at some very slow speeds. Looking at top UDMA mode may not be required. We didn't even have those before late nineties :) – XTL Jul 12 '10 at 08:06
  • I'm puzzled by the concern over not receiving SCSI commands. IDE commands aren't all that complicated. On a different subject, given that the minimal amount of memory in the ATMEGA makes throughput unimportant, transfer speed should be as slow as possible for convenience. – Chris Stratton Jan 03 '11 at 01:05
  • 1
    Err... I think you're thinking of Serial attached SCSI (or SAS), yes? -- SATA uses ATA commands (hence the presence of "ATA" in the acronym) -- which should be pretty similar to the commands that IDE (now called "PATA") uses... – BrainSlugs83 Aug 08 '14 at 05:06
  • 1
    Actually no, I was assuming that because Linux handles SATA the same way it does SCSI (as opposed to treating it like IDE) there must have been some similarity but I see now there isn't. For anyone else who might be curious, this is a fantastic explanation of ATA vs IDE vs SATA vs SCSI vs ATAPI: http://unix.stackexchange.com/a/144565/6662 – Malvineous Aug 12 '14 at 06:06