Mail Archives: geda-user/2013/07/11/16:36:20
This is a multi-part message in MIME format.
--------------090805060303010608000702
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
On 07/11/2013 12:10 PM, Rob Butts wrote:
> BTW -- Now would be a good time to take a quick peek at how many bytes
> your audio file is, and how much flash space you have in your
> microcontroller.
>
> The raw file is 6.8 kB which I would provide eeprom for.
OK, so something like a serial eeprom chip hanging off of your
microcontroller? That changes the picture. In that case, you just need
to get whatever tool you use to program the eeprom to stuff the binary
file into it. If there is a way to write the eeprom from your uctlr,
then maybe you want to implement a serial download protocol so you talk
to the uctrl with a serial cable and it stuffs the data into the eeprom.
That said, for a file that is only 6.8kB, I'd be looking at a way to
store that in the uctlr flash just to reduce the parts count.
>
> With AVR's, you would typically put just enough linkage dictionary
> around the binary blob to create a data section (using a simple tool).
>
> That is quite a mouth full. Linkage dictionary?
The stuff in a .o file that defines external references and exports
externally reference-able addresses.
>
> I'm learning a lot just from this question. I don't use linux much
> only for schematic capture and board layout. From going through the
> emacs info I learned that it can be an IDE. Is this an IDE that most
> people use to write c code in?
emacs, or Eclipse. Or some of us are old-school and think vi and
makefiles are perfectly sufficient.
> I should be able to write a short c program to read that file correct?
You mean on your workstation? Sure. It's just a binary file. fopen and
start reading.
If you mean on your microcontroller, the answer to that depends on how
you store it.
> I'm currently trying to learn more about emacs.
> Thanks for your help.
>
>
> On Thu, Jul 11, 2013 at 2:37 PM, Dave Curtis <davecurtis AT sonic DOT net
> <mailto:davecurtis AT sonic DOT net>> wrote:
>
> On 07/11/2013 10:15 AM, Rob Butts wrote:
>> All good questions!
>>
>> I'm not sure how I'm going to read that file into memory. At
>> this point I'd like to see what is in it and thought it might
>> help me figure out how to read it into memory.
>>
>> I'll be using a microchip micro. I've never done anything like
>> this so I'm just trying to figure it out.
> What you have is a binary data file that you want to flash into
> the microprocessor somehow, in such a way that your program can
> find it. I know how to do this for AVR's... but don't use
> Microchip processors, so you'll need to find the equivalent.
>
> You have two issues to solve:
>
> 1) get the binary data into a format that can be incorporated into
> the binary image of your program, at which point the programmer
> should be happy to stuff it into the chip.
>
> 2) make the address of the binary data available to your program
> as a pointer.
>
> With AVR's, you would typically put just enough linkage dictionary
> around the binary blob to create a data section (using a simple
> tool). This becomes just another .o into the linker. The C
> program makes an external reference to the beginning of the data
> section to set a pointer. Drop the whole works into the linker so
> that it can sew together the external references, and from there
> on its just the normal flow for flashing an image.
>
> BTW -- Now would be a good time to take a quick peek at how many
> bytes your audio file is, and how much flash space you have in
> your microcontroller.
>
> -dave
>
>
>
>>
>>
>> On Thu, Jul 11, 2013 at 12:37 PM, Gareth Edwards
>> <gareth AT edwardsfamily DOT org DOT uk
>> <mailto:gareth AT edwardsfamily DOT org DOT uk>> wrote:
>>
>> On 11 July 2013 17:17, Rob Butts <r DOT butts2 AT gmail DOT com
>> <mailto:r DOT butts2 AT gmail DOT com>> wrote:
>> > That gave me a .raw file but I can't open it to see the
>> data and if I double
>> > click on the file I get an Open With window suggesting a
>> slew of
>> > applications.
>> >
>>
>> The bytes of that file are the bytes of the audio data. Why
>> do you
>> need to see them? (hexl-mode in Emacs or any other hex editor
>> will let
>> you if you really think you need to)
>>
>> You said you were going to "store it in memory on a board and
>> then
>> DtoA it to a speaker when needed." - how do you intend to get
>> it into
>> the board memory?
>>
>>
>
>
--------------090805060303010608000702
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 07/11/2013 12:10 PM, Rob Butts
wrote:<br>
</div>
<blockquote
cite="mid:CALSZ9grGrmc-T1Z6bUgFwj2z-1GmxwgXm3JfU9T9vD0fJ=DAzw AT mail DOT gmail DOT com"
type="cite">
<div dir="ltr">
<div>
<div>
<div>BTW -- Now would be a good time to take a quick peek at
how many bytes your audio file is, and how much flash
space you have in your microcontroller.<br>
<br>
</div>
The raw file is 6.8 kB which I would provide eeprom for.<br>
</div>
</div>
</div>
</blockquote>
OK, so something like a serial eeprom chip hanging off of your
microcontroller? That changes the picture. In that case, you just
need to get whatever tool you use to program the eeprom to stuff the
binary file into it. If there is a way to write the eeprom from
your uctlr, then maybe you want to implement a serial download
protocol so you talk to the uctrl with a serial cable and it stuffs
the data into the eeprom.<br>
<br>
That said, for a file that is only 6.8kB, I'd be looking at a way to
store that in the uctlr flash just to reduce the parts count.<br>
<blockquote
cite="mid:CALSZ9grGrmc-T1Z6bUgFwj2z-1GmxwgXm3JfU9T9vD0fJ=DAzw AT mail DOT gmail DOT com"
type="cite">
<div dir="ltr">
<div>
<div><br>
With AVR's, you would typically put just enough linkage
dictionary around the binary blob to create a data section
(using a simple tool).<br>
<br>
</div>
That is quite a mouth full. Linkage dictionary? <br>
</div>
</div>
</blockquote>
The stuff in a .o file that defines external references and exports
externally reference-able addresses.<br>
<blockquote
cite="mid:CALSZ9grGrmc-T1Z6bUgFwj2z-1GmxwgXm3JfU9T9vD0fJ=DAzw AT mail DOT gmail DOT com"
type="cite">
<div dir="ltr">
<div><br>
I'm learning a lot just from this question. I don't use linux
much only for schematic capture and board layout. From going
through the emacs info I learned that it can be an IDE. Is
this an IDE that most people use to write c code in? </div>
</div>
</blockquote>
emacs, or Eclipse. Or some of us are old-school and think vi and
makefiles are perfectly sufficient.<br>
<blockquote
cite="mid:CALSZ9grGrmc-T1Z6bUgFwj2z-1GmxwgXm3JfU9T9vD0fJ=DAzw AT mail DOT gmail DOT com"
type="cite">
<div dir="ltr">
<div>I should be able to write a short c program to read that
file correct?</div>
</div>
</blockquote>
You mean on your workstation? Sure. It's just a binary file.
fopen and start reading.<br>
<br>
If you mean on your microcontroller, the answer to that depends on
how you store it.<br>
<blockquote
cite="mid:CALSZ9grGrmc-T1Z6bUgFwj2z-1GmxwgXm3JfU9T9vD0fJ=DAzw AT mail DOT gmail DOT com"
type="cite">
<div dir="ltr">
<div> I'm currently trying to learn more about emacs.<br>
</div>
</div>
</blockquote>
<blockquote
cite="mid:CALSZ9grGrmc-T1Z6bUgFwj2z-1GmxwgXm3JfU9T9vD0fJ=DAzw AT mail DOT gmail DOT com"
type="cite">
<div dir="ltr">Thanks for your help.<br>
</div>
<div class="gmail_extra"><br>
</div>
</blockquote>
<br>
<blockquote
cite="mid:CALSZ9grGrmc-T1Z6bUgFwj2z-1GmxwgXm3JfU9T9vD0fJ=DAzw AT mail DOT gmail DOT com"
type="cite">
<div class="gmail_extra"><br>
<div class="gmail_quote">On Thu, Jul 11, 2013 at 2:37 PM, Dave
Curtis <span dir="ltr"><<a moz-do-not-send="true"
href="mailto:davecurtis AT sonic DOT net" target="_blank">davecurtis AT sonic DOT net</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div text="#000000" bgcolor="#FFFFFF">
<div class="im">
<div>On 07/11/2013 10:15 AM, Rob Butts wrote:<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>
<div>All good questions!<br>
<br>
</div>
I'm not sure how I'm going to read that file into
memory. At this point I'd like to see what is in
it and thought it might help me figure out how to
read it into memory.<br>
<br>
</div>
I'll be using a microchip micro. I've never done
anything like this so I'm just trying to figure it
out.<br>
</div>
</blockquote>
</div>
What you have is a binary data file that you want to flash
into the microprocessor somehow, in such a way that your
program can find it. I know how to do this for AVR's...
but don't use Microchip processors, so you'll need to find
the equivalent.<br>
<br>
You have two issues to solve:<br>
<br>
1) get the binary data into a format that can be
incorporated into the binary image of your program, at
which point the programmer should be happy to stuff it
into the chip.<br>
<br>
2) make the address of the binary data available to your
program as a pointer.<br>
<br>
With AVR's, you would typically put just enough linkage
dictionary around the binary blob to create a data section
(using a simple tool). This becomes just another .o into
the linker. The C program makes an external reference to
the beginning of the data section to set a pointer. Drop
the whole works into the linker so that it can sew
together the external references, and from there on its
just the normal flow for flashing an image.<br>
<br>
BTW -- Now would be a good time to take a quick peek at
how many bytes your audio file is, and how much flash
space you have in your microcontroller. <br>
<span class="HOEnZb"><font color="#888888"> <br>
-dave</font></span>
<div class="im"><br>
<br>
<br>
<blockquote type="cite">
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">On Thu, Jul 11, 2013 at
12:37 PM, Gareth Edwards <span dir="ltr"><<a
moz-do-not-send="true"
href="mailto:gareth AT edwardsfamily DOT org DOT uk"
target="_blank">gareth AT edwardsfamily DOT org DOT uk</a>></span>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0pt
0pt 0pt 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div>On 11 July 2013 17:17, Rob Butts <<a
moz-do-not-send="true"
href="mailto:r DOT butts2 AT gmail DOT com"
target="_blank">r DOT butts2 AT gmail DOT com</a>>
wrote:<br>
> That gave me a .raw file but I can't open
it to see the data and if I double<br>
> click on the file I get an Open With
window suggesting a slew of<br>
> applications.<br>
><br>
<br>
</div>
The bytes of that file are the bytes of the
audio data. Why do you<br>
need to see them? (hexl-mode in Emacs or any
other hex editor will let<br>
you if you really think you need to)<br>
<br>
You said you were going to "store it in memory
on a board and then<br>
DtoA it to a speaker when needed." - how do you
intend to get it into<br>
the board memory?<br>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</body>
</html>
--------------090805060303010608000702--
- Raw text -