This Should be Easy, Right?

I'm new here and haven't gotten and Arduino yet. Just want to make sure this is possible and reasonably easy first.

I need to program it to read a PWM signal and modify the pulse width. I need to use a 2D table that will take the frequency of the PWM signal and a 0-5V input, return a value and then use that value to modify the pulse width and then output that PWM signal.

Also, the table needs to be able to be edited easily by the end user. Something HTML based would be perfect.

I hope that's not too much to ask.

-Steve

Timing a PWM isn't so hard, if the overall period isn't too short (frequency too high).

Doing a 2D lookup according to a formula with two arguments isn't hard.

Setting the new PWM on the output is trivial.

Editing the table on the PC and feeding it by serial port in a simpler format, like raw bytes, to repopulate the table in Arduino RAM isn't hard. But this will require the table to be in RAM, and the ATmega168 only has 1024 bytes of RAM total. You'd have to decide what the program is doing: timing PWM or reloading the table, at any given time.

The table can be larger (more rows or columns) if you store it in the prom instead of RAM. This would require you to load the whole program, data and all, for any adjustment to the table. This isn't too daunting, just have to stop all functions, wait for the program to be reloaded, wait two more seconds for the update to kick in, and back to work.

The "easily editable by the user" part is on the PC. I doubt you'd be happy trying to implement an editor on the Arduino itself. And personally, I think HTML is a horrible format for editing a table of data. Comma-separated value (CSV) format would be what I'd prefer. But that's just me.

Awesome reply ... thanks.

Frequency is only 8KHz max and I was thinking that a 16x16 table was be adequate resolution. Editing the table doesn't have to be on the fly.

I'm with you, I don't mind editing a CSV file but I want to make it pretty for everybody else. That said, functionality is most important.

Looks like I need to pick up an Arduino and start playing around.

Any tips, tricks or pointers would be appreciated.