SD Cards anyone?

Anything not specifically related to NBTV, but at least of some technical nature that might be of interest to NBTV members. Items for sale and links to retailers do not belong here.

Moderators: Dave Moll, Steve Anderson

Postby M3DVQ » Sat Feb 04, 2012 2:04 am

Steve Anderson wrote:I do tend to agree, the 40 pins (less one) doesn't put me off nor do the commands which as you say are somewhat simpler. What does is the size, weight and primarily the power consumption of a hard-drive...assuming that's what you were inferring.


Aye, it's not such a big deal when you already have a huge PSU on the desk to drive everything else. There is CF which has an ATA compatible mode as you mention.

Steve Anderson wrote:Not having used a Spectrum I didn't know it had an SPI interface. Here I'm starting from zero and trying to minimize the number of chips required. The 40-pin device has most of its ports unused, I plan to replace it with a 'reduced' version when my supplier here can be bothered to get some.

There is no native SPI. You could bit bang on a decoded I/O port but I have a feeling that the interface I've seen has a simple pair of SIPO and PISO shift registers so you can read and write 8 bits at a time.
I don't own that particular interface so I don't know, as I say I stick with IDE as all you need is a 7410 and a pnp transistor to hook it up to the cpu :)
M3DVQ
Just nod and pretend you understand me
 
Posts: 338
Joined: Sat Feb 10, 2007 10:52 am
Location: Lincolnshire

Postby Steve Anderson » Sun Feb 19, 2012 6:14 pm

I've had no time since the last post to work on this but managed to squeeze in a few hours this morning.

The good news is that I'm able to read and now write to the SD cards in native format, i.e. like it was one huge EEPROM. The only constraint is that writing has to be in 512-byte blocks and starting on integer multiples of 512-byte boundaries.

Now the above is not strictly true for V1.xx cards (standard capacity, up to and including 2GB) but it is for SDHC. It's no real limitation and does make the code simpler and I may as well get used to it for cards of 4GB plus where there is no choice.

Before someone asks, I haven't done any speed tests, that's to come later...

Steve A.
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 5360
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Postby Steve Anderson » Sun Mar 11, 2012 8:18 pm

This hasn't 'gone away', what little time I've had for this has been devoted to the slow-speed logger application which is coming on quite well.

As currently configured the logger has two 12-bit A-D channels (0-5V span), two 10-bit A-D channels (also 0-5V span), two temperature ports, from -55 to +125 Celsius and two 8-bit logic ports.

The logging interval can be 1s, 2s, 5s, 10s, 30s, 1min, 2min, 5min, 10min. The A-D inputs can either be a single reading at the interval point or averaged between interval points at once per second.

An external trigger can also log events on an 'as required' basis. I intend to add bounds to the software such that it only starts logging (for example) when an analogue channel goes above 1.25V and/or a temperature exceeds 70 Celsius. A pre-trigger also is intended such that you can log events leading up to the set bound by some duration of time....and also when things return to normal, a post-roll.

Now what has this got to do with NBTV? Reducing the number of inputs to two (only) analogue channels and ramping up the sample speed will allow NBTV to be recorded as a stereo .wav file, either at 48kHz or 44.1kHz. DC coupled onto an SD Card...here's where I am returning to the start of this thread...obviously the audio doesn't need to be DC-coupled.

As things are the NBTV video could be 12-bit (it doesn't need to be) but the audio at 12-bits is one sixteenth of the resolution of an audio CD, but for speech and non-critical audio listening it's not that bad. If I could get 16-bit audio A-Ds here at a sane price then 16-bit it would be...ho hum...

DC-coupled playback of the files on the SD Card is envisaged, and using a PC compatible file system (FAT32) allows then to be stored on any machine that has an inbuilt or attached SD Card reader.

A couple of other small advantages with this is the lightweight and small nature of the device compared to a desktop PC, and a laptop (generally) only has a mono mic input for recording.

More to come in due course, suggestions and ideas (especially regarding the NBTV application) are most welcome.

Steve A.
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 5360
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Postby AncientBrit » Mon Mar 12, 2012 6:34 pm

Steve,

If you are successful (and you usually are) do you intend to publish the NBTV recorder here or in the NBTVA newsletter?

Cheers,

Graham
AncientBrit
Green padded cells are quite homely.
 
Posts: 858
Joined: Mon Mar 26, 2007 10:15 pm
Location: Billericay, UK

Postby Steve Anderson » Mon Mar 12, 2012 10:32 pm

AncientBrit wrote:If you are successful (and you usually are) do you intend to publish the NBTV recorder here or in the NBTVA newsletter? Graham


Now here I walk a tightrope. Once complete the first thing I wish to do is place it here on the forum, the advantage being the immediacy of this media. But as Jeremy has pointed out that should an item appear here then for a large percentage of NBTVA members it becomes 'old news' and is not worth re-printing in the newsletter for the bulk of NBTVA members.

So Jeremy has to balance up whether to print or not...and of course he may with good reason may hold it over until a later issue. Then there is the length of the item. If it's more than 2-3 pages of normal NBTVA-format printing, then there is a very good chance it will be held over for at least another three months. Some items I've done have been delayed nine months. It's no compliant, just the way things are...

Karen O was a very good exponent of keeping things to herself until her item(s) appeared in print, then she was able to address matters pertaining to the article here or via more traditional means. Most of us (myself included) find that too slow in this day and age.

So, back to the tightrope...do I (we?) stop sending items to Jeremy? No, not a good idea...do we wait until said item appears in print then post .pdf version here (a reasonable compromise).

Or, do I (we) announce completion of said article here and those that are really interested can request an early copy? Knowing full well that at some point in the future it might be included in the newsletter?

Your feedback, in addition to Grahams, will be of use for sure, not only for Jeremy, but those that submit items too.

Steve A.
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 5360
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Postby AncientBrit » Mon Mar 12, 2012 11:43 pm

Well that's good news Steve.

I look forward to the article.

It's a difficult call where to publish first.

Perhaps an over-view for the NBTVA newsletter, restricted to a block schematic and one page of text?

Then detailed circuits and compiled code here on this forum?


Cheers,


Graham
AncientBrit
Green padded cells are quite homely.
 
Posts: 858
Joined: Mon Mar 26, 2007 10:15 pm
Location: Billericay, UK

Postby M3DVQ » Tue Mar 13, 2012 12:41 am

You could always do what I do...

Never get around to finishing the project and writing it up :?

I've promised Jeremy an article about my 'scope driver two conventions running now, and it's still sitting on my bench half breadboarded :oops:

:(
M3DVQ
Just nod and pretend you understand me
 
Posts: 338
Joined: Sat Feb 10, 2007 10:52 am
Location: Lincolnshire

Postby Klaas Robers » Tue Mar 13, 2012 5:03 am

Steve, I agree with you. Jeremy got an article of Dominic and me in 2008. It was ready to print in the Newsletter. A year ago, when he asked for dope I sent it again to him. However until now it wasn't published.

Sometimes I get the feeling that Jeremy, just like Doug, doesn't like articles from not English born, or at least not British, members. The NBTVA is an English club and that is how it has to stay.
User avatar
Klaas Robers
"Gomez!", "Oh Morticia."
 
Posts: 1656
Joined: Wed Jan 24, 2007 8:42 pm
Location: Valkenswaard, the Netherlands

Postby Steve Anderson » Tue Mar 13, 2012 1:01 pm

M3DVQ wrote:You could always do what I do.. Never get around to finishing the project and writing it up?


Well that is one answer to the problem, but if everyone did that the only thing anyone would receive would be the Club Sales 'flyer'!

Most of the time Jeremy is crying out for copy, admittedly he prefers short to mid-length articles but sometimes it's hard to squeeze it down to size when diagrams, sketches and/or photos are included.

Which makes me wonder why has there been this fixed 12-page limit. It is an easy size and with the method with which the newsletter is printed it has to be an integer multiple of four pages. So it would have to be 16 pages for the next size up.

Adding pages to the printed version does add cost, so I can see one reason why there is a 12-page limit. However, a .pdf version is far more flexible, but while many still require the printed version that's the way it'll probably stay.

Klaas Robers wrote:Sometimes I get the feeling that Jeremy, just like Doug, doesn't like articles from not English born, or at least not British...


I don't think that's the case, at least I certainly hope it's not. I think that glancing through the back-issues you'll notice that items come from all over the world in a rough pro-rata proportion to the numbers of members in the countries involved.

The NBTVA is naturally UK-centric as that was where it all started, I can only guess that some 80% or more of members are UK based.

It can be frustrating when issues pass by and your item isn't in it. It does take a bit of effort to pull something together and the reward (for me) is to see it in print. I still get a 'buzz' each time.

Everyone does this as a hobby, nobody gets paid and many devote quite a bit of their own time to it, Jeremy being but one example.

Anyway, this doesn't resolve the issue of where, when and how to publish. I did send an e-mail to Jeremy yesterday regarding this dilemma and await his thoughts on the matter.

Steve A.

P.S. This is going somewhat off-topic...nothing unusual for a thread I start!

P.P.S. Regarding the .pdf version of the newsletter, I was under the impression that this matter was to be raised at last years convention...but I've not seen any reference to it.
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 5360
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Postby M3DVQ » Tue Mar 13, 2012 2:06 pm

Steve Anderson wrote:P.P.S. Regarding the .pdf version of the newsletter, I was under the impression that this matter was to be raised at last years convention...but I've not seen any reference to it.


It's gets "raised" every year... Half an hour later Jeremy gets fed up with the circular nature of the conversation and moves on to the next thing on the agenda :roll:
M3DVQ
Just nod and pretend you understand me
 
Posts: 338
Joined: Sat Feb 10, 2007 10:52 am
Location: Lincolnshire

Postby Steve Anderson » Tue Mar 13, 2012 3:06 pm

Hmm...I guess there are proponents of a .pdf version of the newsletter and those that aren't.

One of the arguments against it is that it's easy to send on to a non-member via e-mail, thereby negating the subscription, if done amongst several people it becomes peanuts. But at 7.50 per year it doesn't exactly break the bank.

The question is, has this happened to the files on the back-issue CD? I have a copy which goes from the very first 'Ideas Pages' right up to Vol. 33 No. 3 , I assume later versions also include more recent copies.

The average size of each .pdf is just over 3MB, nothing in today's world, although with the new format and colour this might double. I've not seen anything regarding these being distributed, and let's hope that holds true. With the mature and sensible membership we generally enjoy I think that would be the same for the newsletter.

I scan the printed copies I receive and bin the printed version, there is no reason why I couldn't forward these on to others, but I don't. So in my case the cost and effort of printing and postage is wasted.

As I have mentioned before the BATC's CQTV magazine/newsletter can be sent as a .pdf...I don't know if they have any problems with 'piracy'. After an issue is one year old it's put on their website for free download.

An old-tech 'piracy' method would be the use of a photocopier...they aren't the old smudgy blurry copies of old, with some it's hard to tell the original and copy apart.

Steve A.
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 5360
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Postby Viewmaster » Wed Mar 14, 2012 7:21 pm

Klaas Robers wrote:Sometimes I get the feeling that Jeremy, just like Doug, doesn't like articles from not English born, or at least not British, members. The NBTVA is an English club and that is how it has to stay.


That certainly seems not to be the case for new members to this forum since the beginning of this year.
6 are from the UK and at least 17 from non UK countries, including two from your own neck of the woods.
“One small step for a man,"......because he has Arthritis.
Albert.
User avatar
Viewmaster
Frankenstein was my uncle.
 
Posts: 1306
Joined: Fri Apr 06, 2007 4:50 am
Location: UK Midlands

Postby DrZarkov » Wed Mar 14, 2012 11:17 pm

But at the last convention it was very clearly pointed out that this forum is no part of the NBTVA. In fact, some members really seem to hate this forum "with all that silly names".

(I wonder why my callsign "DO2DRZ" is less silly than "DrZarkov. For younger people a call sign sounds like the name of an android from "Starwars"...)
User avatar
DrZarkov
I think I've had a cranial implosion.
 
Posts: 1041
Joined: Mon Feb 19, 2007 11:28 pm
Location: Kamp-Lintfort, Germany

Re: SD Cards anyone?

Postby Steve Anderson » Wed Jan 07, 2015 2:22 pm

Another year rolls by and it's time I re-started this thread. This has been brought on by the fact that my workbench is full of 'real work' and this requires no space at all...the board simply sits on a shelf, all the rest is done from the PC. The other NBTV-related stuff requires use of the workbench, so I intend to return to them later.

The original intention was to use SD Cards as a medium to record and play signals that ideally require DC-coupling through the whole signal path (NBTV). Most if not all PC's do not meet this requirement, nor does the vast majority of audio equipment.

At first I was simply going to use the SD card as a glorified EEPROM which is what it really is, in a 'Sea of Sectors' mode. But I relented and have decided to implement a file-system, FAT32. This allows transfer to/from a PC which can read/write SD Cards which must mean all of them in practice - with a suitable card reader.

Using FAT32 with SD Cards does raise some issues, namely the card size and type. Standard SD cards up to and including 2GB are usually formatted FAT16 (or simply FAT in M$ speak) which this system cannot read. In addition they are addressed in byte-mode rather than sector/LBA mode. So anything less than 4GB is a no-go for this.

The FAT32 system for SD Cards is used for 4GB to 32GB cards, perhaps beyond, I don't have greater than that capacity and I have done minimal research (so far). These cards are labelled SDHC, above 32GB they are called SDXC which are 'down the road' for now.

What might this be capable of? Say two channels (NBTV video CH1, audio CH2) sampled at 48kHz at a 16-bit depth. That's 192kB/s which by todays standards is s-l-o-w. A 4GB card will store over six hours at that rate!

Now unless you want to pay $$$$ to the SD Card Association for the licence to use their SD-mode and obtain the specification you are forced to use SPI mode, one-bit transfer mode instead of four, even so it should be possible. So I am viewing this as a proof-of-concept exercise for the time being.

Progress? Cards initialize correctly and the basic data extracted to use the FAT32 file-system extracted. Below is a screen-shot of the initialization process then the raw data of the root directory.

The root directory shows in the first two lines the volume name (here 4GB B), the two lines of long file-name data the 'Doze always writes even if the file-name is in old 8:3 format. Then two lines of the data we need, the file-name (1KHZ1HR.WAV), then in amongst a load of crud we don't need (time/date etc.), the starting cluster and the file-size. This root directory has only this one file. This is all we need to produce a display like good old DOS...

a:\dir

...and so on.

What I see looming on the horizon is going to be a speed/data-rate issue, but I'll get to that in due course...it is proof-of-concept.

Diagram attached of hardware which is in a state of flux, hence the various colours. NOTE: 3.3V, not 5V. The 5V is only for the external A-Ds, the PIC internal one is too slow.

I hope to be able to use sample rates of 24, 32 and 48kHz, perhaps lower but they're no good for NBTV.

I DO NOT intend to use 44.1, 22.05 or 11.025kHz...as it's simply horrid.

Steve A.
Attachments
Init SD Card 1.gif
Init SD Card 1.gif (47.57 KiB) Viewed 14196 times
Root Directory 1.gif
Root Directory 1.gif (63.69 KiB) Viewed 14196 times
SD Card NBTV SSDR 1.gif
SD Card NBTV SSDR 1.gif (22.42 KiB) Viewed 14196 times
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 5360
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

Re: SD Cards anyone?

Postby Steve Anderson » Wed Jan 14, 2015 3:23 pm

Not a great deal of activity on this over the past week, but some progress has been made. The timebases for both the sample rates and the PWM outputs are complete. I have even relented and included 44.1 and 22.05kHz, but due to the crystal frequency they're both slightly 'off' by around 100ppm (0.01%), e.g. 44.1kHz is actually 44.0957kHz.

I'm not sure if this will ever develop into a 'proper' recorder but in a bid to rationalize the hardware I have moved things around such that it can fit into a 28-pin version of the micro, a PIC18F25K20. However it does lack record-level metering and some form of display, say a 2x20 character LCD, to scroll through and choose files for playback. The existing 40-pin version would allow this.

The 28-pin version is, for all intents and purposes, identical except that PORTD and PORTE are absent.

Steve A.
Attachments
SD Card NBTV SSDR 2.gif
SD Card NBTV SSDR 2.gif (21.05 KiB) Viewed 14152 times
User avatar
Steve Anderson
"Fester! Don't do that to 'Thing'"
 
Posts: 5360
Joined: Fri Mar 30, 2007 10:54 pm
Location: Bangkok, Thailand

PreviousNext

Return to Off Topic

Who is online

Users browsing this forum: No registered users and 22 guests

cron