Pages: 1 [2]   Go Down
Author Topic: AD9850 DDS with Hitachi compatable LCD (16x2) and a rotary encoder  (Read 9662 times)
0 Members and 1 Guest are viewing this topic.
Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1122
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

As per your post I opened C/users/my name/documents/arduino/libraries/Rotary . I can see all the files mentioned by you in the "Rotary".
Good.
But when I opened the IDE / "sketch/import library " I can see the name "Rotary" in it but when I click it open ,it is totally  empty (only the name is there).
That's as it should be.  You don't get to see the code, but at the time of compile, the IDE will load that code for you so the functionality is available to your code (not copied into it, but referred/linked to at compile time).
All my efforts to install it properly is yet to succeed.  I am wondering whether you can post your "Rotary" code as seen in your IDE sketch library.
I'm sorry but I don't understand your question here.  I have no rotary code.  Here is the process I followed: I simply downloaded and copied the library files to the correct directory, started the IDE, pasted your code from the first post, changed the lower case r in rotary.h to a capital R in Rotary.h then pressed compile...and it does.

I can't see what it is that's broken on your side, but hopefully from above you'll see something smiley

Cheers !
Geoff
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Geoff,
               At last I managed to compile the code. Thanks to your cool commonsense advice. I installed the Rotary code from Github in the libraries folder and again reopened the IDE and replaced "rotary" by Rotary. Now it works well in the AD9851 sketch and the ATMega328 chip with the code is controlling the AD9850 to perform as a the HF VFO is working as per the design. Thanks again for all your efforts and time. Hope we can keep in touch in future.
              By any chance are you a Ham? I am a US Ham with call sign AB9XC and my name is Pravinkumar Anandan . You can reach me at ab9xc@yahoo.com any time.

With best regards,
(Dr Pravinkumar)
Logged

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1122
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's just the best news!  Glad to have you up and running finally.  And apologies it feels I should have got you to this point days ago  smiley-eek
Thanks again for all your efforts and time. Hope we can keep in touch in future.
Any time.  And sorry, but it's a no on the ham question.  I'm far too busy with this Arduino shenanigans to have a 2nd hobby  smiley

All the best, Geoff
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Geoff,
                    It is not your fault at all and I have to salute you for your time and patience ,I am sorry I am so bad in computer coding such that I failed to understand what other people's instructions. Anyway I am happy the problem is solved. The more important thing is that you made me understand how to add a library to the sketch from scratch. This is great as far I am concerned.For me learning is more important than just the immediate problem solving . 
                   I understand you are an expert in coding etc. If that is the case I would like to get some guidance from you regarding how to learn the coding from scratch. I know there are any number of online articles ,books and other literature available. That is the problem . I am not sure where to start what is the most optimum way to learn the coding without spending huge time on it . Whenever time permits I request your inputs towards this.
                  Once again thanks for you time and efforts and hope to keep in touch with you.

With regards,
(nivar)
nivar_p@yahoo.co.in
Logged

Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1122
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi

If it's just coding for Arduino you're after, I suggest just run with Arduino specific tutorials and you'll cut out all the (important, but not directly relevant) other aspects of coding that make up the rest of the 6 year degree course  smiley

If you're up for some video tutorials, these by Jeremy Blum are very good, and you can keep coming back to them for reference.  In the process some useful electronics interfacing information is also gained.  Also the tutorial series at the Adafruit learning system are very good, and expand into some decent projects.

Cheers !
Geoff
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

Offline Offline
Newbie
*
Karma: 0
Posts: 25
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Geoff,
                  Thanks for the info on Arduino learning materials. I find the  Jeremy Blum blog very informative and useful . Ultimately what I want is the ability to write independent C/Cpp programs at least into various Atmega and PIC processors as per different project requirements. I don't want to spend too much of time for that . What I require is a good starting point from which I can build up my code writing skills. Once again thanks for your time.

With regards,
(nivar)
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've only just found out about these little DDS units, acquired one, came here, found the OP's code near the beginning of the thread and thought it would be ideal just to get the unit up and running for a first test. Despite doing all the obvious things (such as changing 'rotary' to 'Rotary') I had exactly the same problems down to the same error messages as the OP originally did when trying to import the 'Rotary' library, despite having been to Github on the link earlier in the thread to download it.

After running around in circles like the OP I finally realised what I had done wrong: On Github, I just right-clicked on each of the individual files listed and did a 'save as' to the Arduino/libraries/Rotary folder that I had already created for the purpose. A long time later it finally occurred to me to look at the files I had saved and they turned out to be web pages :-)

So, back to the Github page, looked more carefully, found the download button for the single .zip file of the 'Rotary' library, downloaded it, extracted it into Arduino/libraries/Rotary (allowing it to overwrite all the earlier bad files), exited from the Arduino IDE and went back in, and was at last able to compile the OP's original code.

Incidentally, my thanks to the OP ('Nivar') for that code, which sped things up a lot for me - I didn't have an encoder so I modified it to use some extra switches: Increase frequency by step size / Decrease frequency by step size, Increment step size (as before) and I also added a Decrement step size button as well, for convenience.

I have to say these little DDS units are incredibly powerful for the price. Although originally for RF use, I took mine all the way down to the low audio frequency range and it could just as easily be used to make a precision audio sine wave generator.

Only one drawback with them, and that is that the current consumption is quite high - in fact, the crystal oscillator and chip both run quite warm, with the module taking around 100mA from a 5V supply, which means they wouldn't really be viable in handheld battery powered equipment.

  
Logged

Pages: 1 [2]   Go Up
Jump to: