Page 1 of 2

Using every function on a dsPIC

Posted: Sat Dec 11, 2010 5:37 pm
by SolTurboLove
I'm currently engaged in trying to use every possible function on a dsPIC30F4011 (for my 4th year ECE design)
-128x64 graphic LCD
-MMC reader
-RS232 interface
-all 9 a/d converters
-4x4 keypad
-real time clock

There's actually not enough pins to do all that, so i'm looking into connecting two dsPICs together using the SPI or I2C bus. (headache pending...)
So far things are going pretty well, i hacked together some code to make parts of it run, i'm working on reworking the whole thing in C.

Comments so far:
- I hate using other people's code. it's nice to look at, but a headache to try and integrate into your own.
- Transreflective LCDs look like DOS.

Image

Re: Using every function on a dsPIC

Posted: Sat Dec 11, 2010 5:45 pm
by Tetragrammatron
Awesome! That looks fantastic...I'm just starting PIC programming myself (just picked up an adjustable PIC programmer that can do a range of PIC pin sizes). Would you mind sending or posting your code? My native language is C, but I haven't programmed PICs before. I'd just be interested in poking through some code like yours.

Re: Using every function on a dsPIC

Posted: Sun Dec 12, 2010 3:07 am
by SolTurboLove
I'd love to...but i think if you're just getting into PIC programming this may be a bit much for you...truth be told i'm learning a lot about dsPIC myself as I go.
I'd suggest starting with a PIC12F or PIC16F microcontroller, and i have a tonne of C code for those which would be more beneficial i think...i'll start up a new thread with projects that are completed and you can choose from that

Re: Using every function on a dsPIC

Posted: Mon Dec 27, 2010 9:15 pm
by Tetragrammatron
Excellent, that'd be great. I still haven't busted out my PIC programmer yet, been too busy with the holidays and all. I'd love that C code when you have the time.

Re: Using every function on a dsPIC

Posted: Tue Jan 18, 2011 5:19 pm
by shepting
Very cool. I was thinking of trying to create an iPhone app using every library but it can get out of hand pretty quick.

Re: Using every function on a dsPIC

Posted: Wed Jan 19, 2011 2:11 am
by SolTurboLove
Here's an update,

I have two dsPICs now :| the one on the left will take in analog data and perform FFT/scaling calculations etc. It'll then push data to the second dsPIC on the right, which will handle the Graphics and user interface functions.
Image

I have a serial port output that i can use to output diagnostic messages.(one of a few tricks i like to use when debugging my program code)
I have a little switch in the middle so i can select which PIC is outputting to the port, kinda a hack n slack solution until i get data flowing from one to the other properly.
Here's some example serial port output, i use a really handy terminal program called "realterm".
Image

Posted: Wed Jan 19, 2011 10:35 am
by DigitalOSH
Last night I spent about an hour and a half trying to understand the basics of this stuff (I'm a 100% noob when it comes to this) and found tons of advanced tutorials but nothing basic. Can someone in this thread point me in the right direction?

Re: Using every function on a dsPIC

Posted: Wed Jan 19, 2011 4:57 pm
by SolTurboLove
If it's any consolation, i've actually taken university courses to learn this stuff.
Thankfully, you don't need to understand the ins and outs to be able to use them, but you do need to understand some key fundamentals...
Sounds like a "microcontrollers 101" should be one of our first interactive tutorials, I wouldn't mind putting something together if enough people are interested.

Re:

Posted: Thu Jan 20, 2011 9:12 pm
by Odemia
DigitalOSH wrote:Last night I spent about an hour and a half trying to understand the basics of this stuff (I'm a 100% noob when it comes to this) and found tons of advanced tutorials but nothing basic. Can someone in this thread point me in the right direction?
New to: C programing? Micro controllers? PICs? I2C and SPI bus systems? Ever used a programmer before? It's hard to advise on where to start without knowing anything about your background. Are you comfortable with html code? How are you at wiring do you understand how a three way switch in your house works? Is [http://www.seattlerobotics.org/encoder/ ... asics.html| this] useful to you? If not is it too basic or too advanced?

I can't help you with PIC stuff but I have: a reference book for C programming, a reference book for AVR Programming (different brand of micro controller), and an AVR programmer you can borrow. Start with baby steps. The micro controller equivalent of "hello world" is a blinking light, start there. Then try passing data over serial, then communicating with an LCD...

And don't ever think that you need a degree or formal training in anything. It is defeatist and untrue.

Re: Using every function on a dsPIC

Posted: Tue Feb 08, 2011 3:41 pm
by SolTurboLove
Here's a quick update of the progress:

Added more graphics, 8 analog inputs, and a keypad to switch between the menus.

Image

Here's a test setup, the scope just shows me my max sampling rate, which is 4.3KHz. This may seem slow, but it's still 1000x faster than the type of signals we're sampling(300hz max).

Image

Here's a picture of the graphics being generated on an sinusoidal input signal.

The signal (0-5v) is sampled, converted to a 10-bit number (0-1024), it's then split into pieces, piped over to the second microprocessor, reconstructed, and generated into graphical data.

My next few tasks are to streamline the process so i can show much faster signals.

Image