![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
kmp84
Joined: 02 Feb 2010 Posts: 345
|
Emulate PATA HDD? |
Posted: Thu Aug 14, 2014 1:49 pm |
|
|
Hi Friends!
It is possible to emulate HDD with microcontroller ?
I want to emulate PATA Hard Disk Drive with microcontroller, i.e when connect my device to IDE computer channel my pc to sее standard info, for example:
Model : ST3160813AS
Firmware : CC2J
Serial Number : 9ZP051AG
Disk Size : 160.0 GB (8.4/137.4/160.0/160.0)
Buffer Size : 8192 KB
Queue Depth : 32
# of Sectors : 312581808
Rotation Rate : 7200 RPM
Interface : Serial ATA
Major Version : ATA8-ACS
Minor Version : ATA8-ACS version 4
Transfer Mode : ---- | SATA/300
Power On Hours : 5084 часа
Power On Count : 1302 пъти
Temperature : 39 C (102 F)
Health Status : Тревога!
Features : S.M.A.R.T., AAM, 48bit LBA, NCQ
APM Level : ----
AAM Level : D0FEh [ON] |
|
![](templates/subSilver/images/spacer.gif) |
asmboy
Joined: 20 Nov 2007 Posts: 2128 Location: albany ny
|
|
Posted: Thu Aug 14, 2014 2:10 pm |
|
|
PATA is not a single standard at all -
you should google for info before you go any further
what have you done so far to help yourself? |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9178 Location: Greensville,Ontario
|
|
Posted: Thu Aug 14, 2014 3:07 pm |
|
|
Yes, it is possible but really how much time and effort are you willing to spend on this project?
First problem I saw in your post was the 'want to emulate PATA' yet the data you show says 'SATA'.
You'll need to locate a GREAT reference to the way a PC 'talks' to a harddrive. The actual hardware interface,signalling standards and 'protocol'. Easiest would be to 'emulate' say a small drive, say 120 Megabytes, in 8bit mode. Once you get that working reliably 100%, you'll be able to carry on.
You'll need an 18 series PIC with lots of ram and I/O, I'd probably use the 18F46K22 as I'm familiar with it and _should_ do the job.
Honestly be prepared to spend 3-4 months on the project, it is NOT for a beginner !
Now if it was the 'other way', Using a PIC to read/write to an IDE drive, that was done 2 decades ago, using the then 'new' 16F877.
hth
jay |
|
![](templates/subSilver/images/spacer.gif) |
kmp84
Joined: 02 Feb 2010 Posts: 345
|
|
Posted: Thu Aug 14, 2014 10:49 pm |
|
|
temtronic wrote: | Yes, it is possible but really how much time and effort are you willing to spend on this project?
First problem I saw in your post was the 'want to emulate PATA' yet the data you show says 'SATA'.
You'll need to locate a GREAT reference to the way a PC 'talks' to a harddrive. The actual hardware interface,signalling standards and 'protocol'. Easiest would be to 'emulate' say a small drive, say 120 Megabytes, in 8bit mode. Once you get that working reliably 100%, you'll be able to carry on.
You'll need an 18 series PIC with lots of ram and I/O, I'd probably use the 18F46K22 as I'm familiar with it and _should_ do the job.
Honestly be prepared to spend 3-4 months on the project, it is NOT for a beginner !
Now if it was the 'other way', Using a PIC to read/write to an IDE drive, that was done 2 decades ago, using the then 'new' 16F877.
hth
jay |
Hi "temtronic" !
First thanks to your positive answer ! Always "thinking forward"
Second : Yes, my example wrong, because I have SATA HDD on my PC and get from it.
Third : in my case it is enough my PC to see that you said: "a small drive, say 120 Megabytes, in 8bit mode" |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19383
|
|
Posted: Fri Aug 15, 2014 1:36 am |
|
|
There is a lot to this.
First part, I have to say that if I was being 'cynical', I'd say that if you have to ask such a poorly phrased open ended question, then the answer is almost certainly 'no'....
If you are asking if it is possible to connect a PIC directly to talk to an SATA interface, then the answer is 'no'.
Also, if you are thinking about something you might be able to do as a simple prototype, then the answer is also 'no'.
Key thing is to understand that SATA2, is a very high speed interface. As such, something that requires _very_ tight PCB layouts, and timings that are far beyond a PIC to handle (by several orders of magnitude...). To interface a PIC to an SATA bus, is physically not possible, _except_ by adding a chip to actually handle the interface, which then becomes a question of 'can I talk to this interface controller with a PIC', rather than 'can I talk to the bus with a PIC'.
Key thing to answer, is what you actually want to do?.
If the answer is something like 'emulate a hard-drive with a PIC', you then have the question of what is going to actually control this drive?. If this is a Windows system, and you want therefore to use a file-system, you run into the minimum file-system size limits on Windows etc..
If you actually want to use the PIC as some form of interface 'translator' between some other device, then just how fast the data can be moved, may well become problematical. One of the faster dSPIC's with DMA, may be adequate, but this depends on your targets.
I think it's important to emphasise that this is not what the 'PIC' is good at. Just as when people try to drive large colour displays, where there are dozens (hundreds) of 'better' chips, the PIC is ideal for small interface tasks, where low price is essential, but it is not a great data mover. It's ideal for simple jobs like controlling washing machines, or controlling individual motors on robot arms etc., but it is not really the chip for building the actual 'brain' of a complex robot, or doing graphics etc..
Also, it is worth pointing out, that USB (for instance) is already there on several PIC's, and can move data faster than the PIC itself can then cope with. A device using this to talk to the PC, could be 'started' in only a very few hours, while doing the same via SATA, is likely to take many weeks to reach the same point...
So step back, and give an overview of what you actually want to 'achieve' with this. |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9178 Location: Greensville,Ontario
|
|
Posted: Fri Aug 15, 2014 5:15 am |
|
|
I get from his answer that he wants the PIC to 'look like' a PATA HDD not SATA. The data he displayed was what HDD he has on his PC.
Mr. T is 100% correct there is a TON of code needed to be cut and a PIC just isn't the right choice but more importantly WHY this 'project'?
I know English is not everyone's 1st language and may be hard to tell us why you want to do this.
Even with 20+ years of playing with PICs,over 50 in electronics, I have NO ambition to even start to cut code to have a 'PIC emulate a HDD'. I see no meaningful benefit of wasting thousands (yes, 1000s) of hours on this project.
While the 'concept' or 'idea' is interesting the actual code necessary is HUGE and COMPLICATED. As Mr. T said, the PIC isn't the proper micro to begin with.
I do admire your ambition but if you tell us more like why you want to do this, we can probably suggest a better project that you CAN complete in a reasonable amount of time.
hth
jay |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19383
|
|
Posted: Fri Aug 15, 2014 7:04 am |
|
|
There is confusion on the drive interface involved, but he says in one reply:
"Yes, my example wrong, because I have SATA HDD on my PC and get from it."
Given that most modern machines won't even have a 'PATA' (IDE) interface now, I think he is talking about SATA. Especially with the reference to '300', which is of course a title reserved for SATA2.
The PIC is very much not 'the tool for the job', but it is possible that it may be, closer than it appears, depending on what the 'job' actually is!... ![Very Happy](images/smiles/icon_biggrin.gif) |
|
![](templates/subSilver/images/spacer.gif) |
kmp84
Joined: 02 Feb 2010 Posts: 345
|
|
Posted: Fri Aug 15, 2014 9:15 am |
|
|
Hi Ttelmah, temtronic and all other !
Sorry for my slow answers !
I want to emulate PATA HDD (parallel HDD older HDD interface) to see my PC (with Windows XP) on IDE channel, HDD with specific manufacture parameter:
Model : xxxxxxxxxx
Firmware : xxxx
Serial Number : xxxxxxxx (Most Important and configurable)
Disk Size :xxx.xx
Buffer Size : xxx
...etc
Only this information nothing else other!
Something like this : http://www.vecoven.com/trs80/trs80.html
It is CLEAR all in this Topic ?
Sorry for my English! ![Smile](images/smiles/icon_smile.gif) |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9178 Location: Greensville,Ontario
|
|
Posted: Fri Aug 15, 2014 10:30 am |
|
|
Question.
Do you want the PIC to be able to read a PATA harddrive and display the information onto a PC screen using a terminal program?
PC with terminal program <----PIC<----->PATA harddrive
If so, there's an article in Circuit Cellar using a PIC 16F877 to read/write to a PATA harddrive. I'll locate the article for you..
If this is what you want, it is possible and a lot easier with a newer PIC.
This is similar to the TRS-80 <---> PATA article you mention.
hth
jay |
|
![](templates/subSilver/images/spacer.gif) |
kmp84
Joined: 02 Feb 2010 Posts: 345
|
|
Posted: Fri Aug 15, 2014 12:30 pm |
|
|
temtronic wrote: | Question.
Do you want the PIC to be able to read a PATA harddrive and display the information onto a PC screen using a terminal program?
PC with terminal program <----PIC<----->PATA harddrive
If so, there's an article in Circuit Cellar using a PIC 16F877 to read/write to a PATA harddrive. I'll locate the article for you..
If this is what you want, it is possible and a lot easier with a newer PIC.
This is similar to the TRS-80 <---> PATA article you mention.
hth
jay |
No, I want ONLY to connect my PIC to IDE channel in PC-motherboard and PC recognize my PIC device as "real" HDD drive with manufacture parameter :
Model : xxxxxxxxxx
Firmware : xxxx
Serial Number : xxxxxxxx (Most Important and configurable for me!)
Disk Size :xxx.xx
Buffer Size : xxx
etc.
PC_IDE <------->PIC |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9178 Location: Greensville,Ontario
|
|
Posted: Fri Aug 15, 2014 2:36 pm |
|
|
OK I understand now! As Mr' T pointed out THAT configuration is very complex, even under DOS6.22 it would be a great challenge, using Windows it might not be possible.
If I had this project I would begin with DOS6.22 and try to get it to work..then...go to Windows.
Do you intend to store data on the drive or just want to recognize it as a 'drive'? What is the real idea behind the project? The more details the better we can suggest ideas!
This is a very,very complicated project......one I wouldn't tackle unless paid a LOT of money.
hth
jay |
|
![](templates/subSilver/images/spacer.gif) |
kmp84
Joined: 02 Feb 2010 Posts: 345
|
|
Posted: Fri Aug 15, 2014 11:03 pm |
|
|
temtronic wrote: | OK I understand now! As Mr' T pointed out THAT configuration is very complex, even under DOS6.22 it would be a great challenge, using Windows it might not be possible.
If I had this project I would begin with DOS6.22 and try to get it to work..then...go to Windows.
Do you intend to store data on the drive or just want to recognize it as a 'drive'? What is the real idea behind the project? The more details the better we can suggest ideas!
This is a very,very complicated project......one I wouldn't tackle unless paid a LOT of money.
hth
jay | Just want recognize it as a hdd drive to simulate hdd with specific ser.number! |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19383
|
|
Posted: Sat Aug 16, 2014 12:27 am |
|
|
I have to ask.
Why?.
Seriously, this is a lot of programming. Whatever hardware is used, there is a few hundred hours of work involved here. The simplest way I can think to do it, wouldn't involve any hardware at all!. In the Microsoft Technet sources, there are example IDE drivers. It'd be far simpler than trying to do this in hardware, to modify one of these, so that you load this driver, and it tells you there is a specific drive there, even when there isn't!....
I'd suspect the poster wants to generate a spoof serial number to get round the security used in some programs/games.
Look at:
<https://www.raymond.cc/blog/changing-or-spoofing-hard-disk-hardware-serial-number-and-volume-id/> |
|
![](templates/subSilver/images/spacer.gif) |
kmp84
Joined: 02 Feb 2010 Posts: 345
|
|
Posted: Sat Aug 16, 2014 1:58 am |
|
|
Ttelmah wrote: | I have to ask.
Why?.
Seriously, this is a lot of programming. Whatever hardware is used, there is a few hundred hours of work involved here. The simplest way I can think to do it, wouldn't involve any hardware at all!. In the Microsoft Technet sources, there are example IDE drivers. It'd be far simpler than trying to do this in hardware, to modify one of these, so that you load this driver, and it tells you there is a specific drive there, even when there isn't!....
I'd suspect the poster wants to generate a spoof serial number to get round the security used in some programs/games.
Look at:
<https://www.raymond.cc/blog/changing-or-spoofing-hard-disk-hardware-serial-number-and-volume-id/> | Hi again , you are right and I found this link before 2 weeks but didn't successed with those software tools . I don't want to lose your time for this topic yet and thank you for help and all advices |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9178 Location: Greensville,Ontario
|
|
Posted: Sat Aug 16, 2014 5:30 am |
|
|
Obviously I'm out of here as there's several viable, known, working solutions to the 'project',sadly not PIC based!
I'd hate to find out just how many sites I'd be blocked from if I changed the HDD serial number.I assume the OP has a dedicated PC for his gaming.
off to the next challenge !!
jay |
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|
Powered by phpBB © 2001, 2005 phpBB Group
|