Pages: 1 [2] 3 4 5   Go Down
Author Topic: The Catweazle  (Read 5705 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
God Member
*****
Karma: 6
Posts: 512
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

1-bit PDM DAC on the LPC.
16-bit 44100Hz resolution.

Nemas problemas smiley

Yes, you can do this on ATmega but there won't be any CPU time left over to update the samples.



* Catweazle 16bit PDM.jpg (102.39 KB, 800x487 - viewed 27 times.)
« Last Edit: March 11, 2014, 03:47:01 pm by janost » Logged

Atlanta, USA
Offline Offline
Edison Member
*
Karma: 53
Posts: 1774
AKA: Ray Burne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
1-bit PDM DAC on the LPC.
16-bit 44100Hz resolution.

Impressive.  What's next?
I still think that for the traditional Arduino dude and dudett out in the Ether, that the Catweazle needs to be tied into the Arduino world via a mini-shield or I2C and used as a co-processor... I/O over on the Arduino side and the LPC doing something that would put the Arduino into a deep sweat.  I betcha a really decent MP3 decoder could be a reality.

Ray
Logged

Offline Offline
God Member
*****
Karma: 6
Posts: 512
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
1-bit PDM DAC on the LPC.
16-bit 44100Hz resolution.

Impressive.  What's next?
I still think that for the traditional Arduino dude and dudett out in the Ether, that the Catweazle needs to be tied into the Arduino world via a mini-shield or I2C and used as a co-processor... I/O over on the Arduino side and the LPC doing something that would put the Arduino into a deep sweat.  I betcha a really decent MP3 decoder could be a reality.

Ray

Nice idea.
I'll think of something.
Logged

Offline Offline
God Member
*****
Karma: 6
Posts: 512
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Now with the PDM mainloop written in assembly the bitstream runs at 3.6MHz

Still with a 44.1KHz samplerate and 16bit resolution.

Code:
asm volatile(
"        mov r0,r3 \n"
"        mov r1,#0xA0 \n"
"        lsl    r1,#24   \n"   //r1=0xA000
"        mov r2,#0x10   \n"
"        lsl    r2,#8    \n"
"        add r2,#0x0C   \n" //r2=0x100C
"        add    r1,r2     \n"  //r1=0xA000100C LPC_GPIO_PORT->W0[3]
"        mov r6,#0xFF   \n"
"        lsl    r6,#8    \n"
"        add r6,#0xFF   \n" //r6=0xFFFF
"        mov r5,#0x01 \n"
"        lsl    r5,#16   \n"   //r5=0x00010000
"loop%=: ldrh   r7,[r0,#0]   \n"
"        add r2,r7 \n"  //r2=phacc
" mov r4,r2 \n"
"        and r4, r5 \n"
" str r4, [r1] \n" //LPC_GPIO_PORT->W0[3]
"        and r2, r6 \n"
" b loop%=        \n"
: [dac] "=m" (DAC)
);
« Last Edit: March 15, 2014, 10:13:46 am by janost » Logged

Offline Offline
God Member
*****
Karma: 6
Posts: 512
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
1-bit PDM DAC on the LPC.
16-bit 44100Hz resolution.

Impressive.  What's next?
I still think that for the traditional Arduino dude and dudett out in the Ether, that the Catweazle needs to be tied into the Arduino world via a mini-shield or I2C and used as a co-processor... I/O over on the Arduino side and the LPC doing something that would put the Arduino into a deep sweat.  I betcha a really decent MP3 decoder could be a reality.

Ray

It could be done in 2 ways.

Either you upload code the LPC shield through the ISP interface in which case it will remain between boots.

Or create a sketch on the LPC that uploads code to the 1K SRAM and executes it.
In that case you could have some reduced instruction set DSP code to just do your task and return the result.
 
SInce I've sacrificed the reset pin for an extra GPIO, the only thing that can reset the chip is toggling the power.
So it may be better to run code in the internal sram?
 
« Last Edit: March 15, 2014, 11:34:56 am by janost » Logged

Atlanta, USA
Offline Offline
Edison Member
*
Karma: 53
Posts: 1774
AKA: Ray Burne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Jan,

Or, a third, the Arduino and the LPC could share a common structure connected via the I2C; said structure hosting the verb, the variables, and the return results. The Arduino would load the structure, send it to the LPC, the ARM would do whatever, and the results would be returned within the same structure for the Arduino to fetch.  So, in the case of MP3, a few verbs would only be necessary.  In the case of a numeric co-processor, we would concoct verbs for floating point routines that would free the Arduino from needing anything but integer math... thus, performance is increased and the overhead of the Arduino doing floats would be eliminated... at least in a hypothetical brain exercise.

Ray
Logged

West Yorkshire, UK
Offline Offline
Edison Member
*
Karma: 41
Posts: 1206
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, these chips are fun to play with and doesnt reqire an ISP programmer.
Plain UART works with the internal bootloader.

Its also 5v tolerant even if it runs at 1.8 - 3.6v

The only pain is the LPCXpresso IDE that runs Eclipse which can be a bit overvelming.

I would like to add the LPC to the Arduino IDE to make it a bit more simple.
It already has support for ARM compiling because of the DUE.


Hi janost,

Just stumbled across this thread. Very interesting. Something like a Pro Mini but with LPC810 or LPC812 would be amazing. Absolutely in agreement that the keys to success would be integration with the Arduino IDE and low price.

Paul
Logged

Offline Offline
God Member
*****
Karma: 6
Posts: 512
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, these chips are fun to play with and doesnt reqire an ISP programmer.
Plain UART works with the internal bootloader.

Its also 5v tolerant even if it runs at 1.8 - 3.6v

The only pain is the LPCXpresso IDE that runs Eclipse which can be a bit overvelming.

I would like to add the LPC to the Arduino IDE to make it a bit more simple.
It already has support for ARM compiling because of the DUE.


Hi janost,

Just stumbled across this thread. Very interesting. Something like a Pro Mini but with LPC810 or LPC812 would be amazing. Absolutely in agreement that the keys to success would be integration with the Arduino IDE and low price.

Paul

I already have a premade PCB for the LPC812.
Its about the size of the pro mini, 39x23mm.


* CatweazlePCB.jpg (10.65 KB, 176x108 - viewed 20 times.)
« Last Edit: March 17, 2014, 09:21:05 am by janost » Logged

Valencia, Spain
Online Online
Faraday Member
**
Karma: 143
Posts: 5302
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There's some on OSH park as well...

eg. https://oshpark.com/shared_projects/KhRpkfcU



« Last Edit: March 17, 2014, 11:22:07 am by fungus » Logged

No, I don't answer questions sent in private messages (but I do accept thank-you notes...)

West Yorkshire, UK
Offline Offline
Edison Member
*
Karma: 41
Posts: 1206
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I already have a premade PCB for the LPC812.
Its about the size of the pro mini, 39x23mm.

What are the other features of your board? I guess the 4 pin header on the right is for serial comms/programming. What is the 8 pin IC on the left side for? EDIT: sorry, you did say before, its for the 2MB flash.
« Last Edit: March 17, 2014, 06:55:11 pm by PaulRB » Logged

West Yorkshire, UK
Offline Offline
Edison Member
*
Karma: 41
Posts: 1206
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There's some on OSH park as well...

I guess that's just a standard 16 pin SMD breakout board. But that's all you need, really. There's not much else I would like to put on a small board. As separate serial comms header, like janost's board. A 3.3V regulator to allow flexibility for external power, and to provide regulated power for other components. Maybe LEDs for power, Rx & Tx. A reset button. And a DTR connection on the serial header to implement auto-reset for re-programming. All that familiar Arduino stuff.

I wonder if someone out there, maybe on eBay, offers a SMD build process and would be able to supply LPC812 soldered to a breakout board? Soldering SMD is beyond my skill & eyesight.

Is the LCP812 available in a DIP package? EDIT: no, but LPC111xL is. 28 pin 0.6" width...

Someone must have implemented Wiring in ARM code. It would just need tweaking for the LCP chips.

Then all I would need is to think up an application to use all that processing speed!
« Last Edit: March 17, 2014, 06:13:15 pm by PaulRB » Logged

West Yorkshire, UK
Offline Offline
Edison Member
*
Karma: 41
Posts: 1206
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

And it runs 30MHz on its internal oscillator without external components.
The stuff I just read on nxp's site says 12MHz on the internal oscillator. So if you are doing something that benefits from 32 bit processing, then much faster than ATmega. But otherwise could be slower?

Paul
Logged

Offline Offline
God Member
*****
Karma: 6
Posts: 512
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The 8pin header is for a 2Mbyte SPI flash.
Used for storage or paged code.

There are pads for the ISP jumper or button.and the standard LED on GPIO0_2 (LCPs variant of LED13).

The LPC812 is not available in DIP so I used SOIC 1.27mm.
Smaller but still hand solderable.

I wrote the IO and delay definitions for wiring.
That makes it possible to use pinMode, digitalWrite, digitalRead and delay in Arduino style.

The bootloader runs at 12MHz default to be able to work from 1.8-3.6v
The sketch runs at 40MHz at 3.6v and 30MHz at 3.3v

You can calibrate the internal oscillator like on the ATmega but it uses a PLL and can run up to 240MHz.
Anything higher than 40MHz requires waitstates on the internal flash.

Most of the instructions on ARM are single cycle and the GPIO is single cycle so its really 39DMIPS.
With 32-bits arithmetic that is really DSP power on a small chip.

 
« Last Edit: March 18, 2014, 03:29:20 am by janost » Logged

Offline Offline
God Member
*****
Karma: 6
Posts: 512
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, I'm selling it premounted with the USB/Serial programming cable.

But you know this site? This will probably get removed.
Logged

West Yorkshire, UK
Offline Offline
Edison Member
*
Karma: 41
Posts: 1206
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

PM me?
Logged

Pages: 1 [2] 3 4 5   Go Up
Jump to: