Yes, they are the same wave form only cosine is 90 degrees ahead, e.g. cos(x) = sin(x + pi / 2) and consequently cos[x] = sin[x + 256] in code. As you said, the array does not have to be generated run-time but then you'd have to re-generate it outside .NETMF if/when you want to change the resolution. Also, I think arrays will end up in RAM anyway and that someone (was it you?) recently investigated the latter and came to that very conclusion. Also, generating the 256 byte array does not take long.sine and cosine are related by a phase shift, so you don't need a separate array (much like your 4-quadrant optimization) I wonder if private static byte[] _sin; could be simply be a constant array (i.e. not need initialization in the constructor, and stored in ROM). Then again, I've found that netmf only seems to be clever like that for strings, but admittedly I haven't tried an array of integers... If not, then perhaps on the upside 'sine table' has a double meaning....
- Netduino Forums
- → hanzibal's Content
hanzibal's Content
There have been 386 items by hanzibal (Search limited from 30-June 24)
#50839 Simple sine table
Posted by
hanzibal
on 26 June 2013 - 01:57 PM
in
General Discussion
#50889 Simple sine table
Posted by
hanzibal
on 28 June 2013 - 06:28 AM
in
General Discussion
Of course, how silly of me not to see that. Sorry.Nope. xpixel=0 is 0. The phase change you see is because the AGENT screen's origin is upper left, and positive Y is DOWN.
#49903 Mayhew Labs MuxShield and TI 74HC4067
Posted by
hanzibal
on 24 May 2013 - 09:08 AM
in
Project Showcase
No, just the bare chip. I'll solder it onto a DIP adapter board.
The one you linked to should work equally well and 4.95 USD is reasonable. I would order it, if it weren't for the shipping costs/time.
#49906 Does any one would like to buy a more powerful STM32F407 MF board?
Posted by
hanzibal
on 24 May 2013 - 10:59 AM
in
General Discussion
Admin: Could you please point to where the forum rules can be found and also clarify which rule(s) was broken?
#50831 Simple sine table
Posted by
hanzibal
on 26 June 2013 - 06:56 AM
in
General Discussion
Hi Paul, adding cosine is a good idea. I cleaned up my inbox just now so PM should work.
#50892 Simple sine table
Posted by
hanzibal
on 28 June 2013 - 12:50 PM
in
General Discussion
Cool, I've been thinking of that too at some point. It would be really nice to have a PC app where you could draw arb forms in free hand and then upload to the chip/board over USB. Also controlling freq and amplitude from the PC app.
Will the AD9831 retrieve output samples from EEPROM as it goes (like a RAMDAC) or will you be uploading a full "period" to the chip before starting it?
#50944 Simple sine table
Posted by
hanzibal
on 29 June 2013 - 10:53 PM
in
General Discussion
#49684 Mayhew Labs MuxShield and TI 74HC4067
Posted by
hanzibal
on 21 May 2013 - 02:47 PM
in
Project Showcase
I'll see if I got one of those multiplexers in my junk box, if so I'll try the driver with an NP I got in there too.
Eric said for the shield to be "100% Netduino compatible with no flaws" but unfortunately, this does not seem to go for the driver class unless only tested for something else than a regular N or NP.
#50967 Simple sine table
Posted by
hanzibal
on 30 June 2013 - 08:01 PM
in
General Discussion
#49820 Mayhew Labs MuxShield and TI 74HC4067
Posted by
hanzibal
on 23 May 2013 - 10:42 AM
in
Project Showcase
I could, but I don't own a NP2 (only an NP) and would probably only use it in trying to help you out so I thought I'll use the bare chip instead.
Didn't find one in my junk box so I ordered a couple of SO24s but by the time I get them, perhaps you'll already solved the problem your self.
We'll see.
#49829 Does any one would like to buy a more powerful STM32F407 MF board?
Posted by
hanzibal
on 23 May 2013 - 01:09 PM
in
General Discussion
Sounds like a really nice board but 200$ is substantial and I think you have to show a working port or people cannot be certain of what they're getting. Also, you will need pictures, lot's of pictures I realize it's kind of a chicken and egg problem.
...or are you saying you've done the port already and got the peripherals working too?
Then I'm really impressed!
#49843 Does any one would like to buy a more powerful STM32F407 MF board?
Posted by
hanzibal
on 23 May 2013 - 04:17 PM
in
General Discussion
great job there! Frankly, this is not for me, I already have hardware laying around to keep me busy for at least a decade.hi,hanzibal,yes,i had done for ethernet,nand flash,nor flash,tft,sram,sdio porting,i will upload the sample board's pics if there are really many people want to buy it,other drivers such as CAN,DCMI I2S will be ported after i take my naturalization test in June....and may i ask you whats the price you would think is ok for you?
#50063 Running out of I/Os
Posted by
hanzibal
on 28 May 2013 - 07:01 PM
in
Netduino Plus 2 (and Netduino Plus 1)
#49939 Running out of I/Os
Posted by
hanzibal
on 24 May 2013 - 07:30 PM
in
Netduino Plus 2 (and Netduino Plus 1)
http://www.ti.com/li...ink/tlc5940.pdf
I think you can use any of the other 15 channels to emulate regular digital outputs by configuring 0% and 100% duty cycle to represent a logic low and high respectively. The latter would ommit the need for a PCF8574.
If its not a secret, I'd still like to know what you'll be using the PWMs (not PWN) for?
#49885 Running out of I/Os
Posted by
hanzibal
on 24 May 2013 - 12:55 AM
in
Netduino Plus 2 (and Netduino Plus 1)
#49864 Running out of I/Os
Posted by
hanzibal
on 23 May 2013 - 09:21 PM
in
Netduino Plus 2 (and Netduino Plus 1)
Not difficult at all, usually these kinds of chips are available in breadboard friendly DIP16 - DIP28 packages. The interface is usually I2C and sometimes SPI. What usually takes time is writing the software.
In the I2C case, you'll only need to connect 2 wires to drive the chip (plus power).
Extra PWM would require something other than a typical expander. For example there's the TLC5940 16 channel PWM LED driver from Texas and I suppose you could use some of its pins for digital output (0% duty = 0 and 100% duty = 1).
I'm not sure what you mean when you say "1 extra Digital RX/TX, both for output only" - do you mean an extra UART or just 2 x digital outputs?
What will you be driving with the PWMs?
#49850 Running out of I/Os
Posted by
hanzibal
on 23 May 2013 - 06:41 PM
in
Netduino Plus 2 (and Netduino Plus 1)
Hi!
The above SX1509 BOB from Sparkfun still stands tall I think, but there are lots of cheaper solutions as well.
It all depends on your requirements:
Do you need analogue, digital or both?
Have many pins / channels do you need?
Do you need input, output or both?
Need interrupts on input pins?
I recently came across the PCF8574 which is a quasi bi-directional I2C controlled digital only 8 bit I/O expander with interrupt capabilities. It's really simple to use, very general purpose and I've written a generic driver class for it and an I2C bus manager.
You can find the code in this post where I use it to drive a 16x2 character LCD in 4 bit parallel mode:
#49500 DFROBOT Buggy
Posted by
hanzibal
on 16 May 2013 - 08:24 PM
in
Project Showcase
#49901 Running out of I/Os
Posted by
hanzibal
on 24 May 2013 - 08:58 AM
in
Netduino Plus 2 (and Netduino Plus 1)
Ok, for the extra I/Os I'd recommend the PCF8574 mentioned before and for which I've already written a simple to use driver.
If I understand correctly, you only need a single PWM channel and freeing up some pins would allow you to use one of the on-board PWMs - correct?
In that case, you'll do fine with just a single PCF8574 as it will add 8 GPIOs to your design.
#49495 DFROBOT Buggy
Posted by
hanzibal
on 16 May 2013 - 04:33 PM
in
Project Showcase
#49950 Running out of I/Os
Posted by
hanzibal
on 25 May 2013 - 12:22 AM
in
Netduino Plus 2 (and Netduino Plus 1)
Yes, that board should work well. Or you could just get the bare chip, it's only 3 USD (plus shipping so could be the same in the end)
#50041 I2C LCD not working on Netduino Plus 2
Posted by
hanzibal
on 28 May 2013 - 12:37 AM
in
Netduino Plus 2 (and Netduino Plus 1)
#50417 I2C LCD not working on Netduino Plus 2
Posted by
hanzibal
on 11 June 2013 - 06:17 AM
in
Netduino Plus 2 (and Netduino Plus 1)
#50546 I2C LCD not working on Netduino Plus 2
Posted by
hanzibal
on 17 June 2013 - 11:16 AM
in
Netduino Plus 2 (and Netduino Plus 1)
Yes, brightness will be slightly dimmer than it would with 5V but it's still bright enough. Contrast is "active low" so no problem there.
#50018 I2C LCD not working on Netduino Plus 2
Posted by
hanzibal
on 27 May 2013 - 01:46 PM
in
Netduino Plus 2 (and Netduino Plus 1)
Thanks for your reply, but have already jumpered the new SCL/SDA pins to A4/A5, so it should be working.
Perhaps I'm missing the point here, but why are you at all bridging the I2C pins - is it because you use some kind of shield with fixed wiring?
If you're otherwise not using A4/A5 from your Netdino, they could easily be in a default configuration where they have a strong negative effect on the I2C data line. You could try configuring them as digital inputs and see if that helps.
- Netduino Forums
- → hanzibal's Content
- Privacy Policy