pic telemetry system


Closed Thread
Results 1 to 24 of 24

Hybrid View

  1. #1
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by comwarrior View Post
    hi everyone,
    I'm new to pic's and pic basic... however when i was 13 i was writing large BASIC programs on my spectrum and have since gone on to HTML, CSS, PHP etc...
    And this tells me you are ??teen . . . no matter, Welcome comwarrior. We always welcome Sharp Kids, when I was 13 only Governments and Giant Corporations had computers, and they used punch cards.
    Quote Originally Posted by comwarrior View Post
    I'm using MPLAB IDE + PBP 244 for compiling (if thats correct?)
    I'm not using MPLAB IDE to compile because my BAS files are not in the compiler dir... so i used the approach listed here by creating a batch file to execute...

    I'm using PIC16F877-20I/P 's...

    I'm just asking what's the best way of doing the following items...

    1) ADC initialization, I can't find much info on setting up the ADC's. What i've got so far is...
    Code:
    Define  ADC_BITS        10     		' Set number of bits in result
    Define  ADC_CLOCK       3     		' Set clock source (3=rc)
    Define  ADC_SAMPLEUS    50    		' Set sampling time in uS
    Define  ADCON0			%11000001
    TRISA = %11111111					' Set PORTA to all input
    ADCON1 = %10000010					' Set PORTA analog and right justify result
    First off, i need to correct the clock source to XT not RC so, will do that later once i found the value it should be...
    My code is directly dependant on the ADC values that come in (nothing to run while it's waiting)... so i want the ADC to run as fast as possible... have i got it right? anything missing?

    2) telemetry link to my laptop... laptop has IR port so I want IR link to PIC to recieve ADC valuse and io values etc...
    i have the IR header (surfice mount mind!) the only way i can think of doing it is to direct drive the IR TX with a FET and use another FET on the reciever...
    I'm also assuming i should be using serin/out at 9600 none inv...
    I want it looping as fast as possible and give me as many ADC samples as possible per second...

    3) i can't find much info on ADC calibration... aparently the ADC can only do upto 5V, after that you need to do something externally? but can't seem to find out exactly what? can someone kick me in the right direction?


    Thanks everyone
    OK, go into the FAQ section of the forum,
    http://www.picbasic.co.uk/forum/forumdisplay.php?f=16 ,here you will find good things, like : http://www.picbasic.co.uk/forum/showthread.php?t=543 , and make use of this to search the forum: http://www.google.com/custom?hl=en&c...ch&sitesearch=
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    ADC does not need Calibration... well... how pedantic do you want to be...

    It will always give you steps of 1/255 or 1/1023 (depending if you are in 8 or 10 bit mode) of VREF. So if VREF is 5v, you get steps of 5*(1/255) or 5*(1/1024) accordingly.

    If VREF=VDD for example, then you rarely get 5.0000v, you'll usually have some arbitrary figure between 4.9 and 5.1v. That can throw your math, if you're making a thousand units and each one has to be precisely identical to the next. It's something that either usually you can live with, or design out with more precise Voltage References or circuitry.

    For high speed, I probably wouldn't chose to use ADCIN. It only takes a tiny number of instructions to grab Data from the ADC anyway, and it's just as easy to do it manually...

  3. #3


    Did you find this post helpful? Yes | No

    Default

    @ joe - Knowledge, but no wisdom = unhelpful
    Practice what you preach and look at my profile it will tell you how old i am...

    @mel - completely avoided the question you tried (and failed) to answer = unhelpful
    I allready know it's set to 5 volts... the question was what do you use to measure more than 5 volts?

    Do you two really think I’d post here without spending days trying to find the info myself? that single one liner "...when i was 13 i was writing large BASIC programs on my spectrum and have since gone on to HTML, CSS, PHP..." should tell you I’m an experienced programmer capable of learning on my own and know to check with people that are 'supposedly' in the know to make sure I’m on the right tracks...

    So far, I’m not impressed...

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by comwarrior View Post
    @ joe - Knowledge, but no wisdom = unhelpful
    Practice what you preach and look at my profile it will tell you how old i am...
    Correct. I did not look at your profile, I do not care about your profile, I was willing to help you even if you were 13. It is a little unusual for a 27 year old MAN to profile himself from his thirteenth year, nevertheless in my rush before going to work, I tried to help. Do not worry, I will not make that mistake again. I believe you just hacked off 2 people, 1. Mel, most able to help, 2 Me, most willing to help. So here is My offer . . . Forget everything I said in My first post and have a nice life Dude.

    So far, I’m not impressed...
    TFB
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  5. #5


    Did you find this post helpful? Yes | No

    Default

    joe, i don't mind 'hacking people off' when 'experts' post that level of rubbish...
    Besides, i doubt it's only two people...
    Perhaps you should do a search for me on utube...

    Don't worrie about the IR link... I've finally (after over yet another day totally searching) found the datasheet for the IR trancever i'm using... and it has the hardware i asked about allready built in AND it is on the same wavelengh as PC IR comms...

    So, we can cross that one off... I found some pic simulation software and it would apear my ADC's are ok... will be playing more with the program, i like it...


    Just one left... hmmm, how to measure more than 5 volts...

  6. #6
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    comwarrior, Use a voltage divider....

    Dave Purola,
    N8NTA

  7. #7
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Hmmm... I must remember to avoid spending time and effort in providing helpful information for at least the more complex part of your posting... and not answering what would be the obvious for 1st grade students of basic electrictity or physics.

    How to get your PIC input to handle more than 5 volts moust have been handled at least a dozen or more times on this forum... the SEARCH facility is a good start - and Joe is correct. For newbies, especially those with attitude, do we really have to regurgitate the same advice over and over again nigh on every month?

    Melanie (biting her lip and remaining polite!)

  8. #8
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by comwarrior View Post
    @ joe - Knowledge, but no wisdom = unhelpful
    Practice what you preach and look at my profile it will tell you how old i am...

    @mel - completely avoided the question you tried (and failed) to answer = unhelpful
    I allready know it's set to 5 volts... the question was what do you use to measure more than 5 volts?

    Do you two really think I’d post here without spending days trying to find the info myself? that single one liner "...when i was 13 i was writing large BASIC programs on my spectrum and have since gone on to HTML, CSS, PHP..." should tell you I’m an experienced programmer capable of learning on my own and know to check with people that are 'supposedly' in the know to make sure I’m on the right tracks...

    So far, I’m not impressed...
    Your second post and you are already offending the people trying to help you. Hmm ... Comwarrior, interesting choice for a name given these three postings. Perhaps you should stick with the advice given in the first reply, and use the search tools you were offered instead.

    I'm with Joe, I would have guessed 16. 27? Really?
    http://www.scalerobotics.com

  9. #9
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default

    I cant' resist!

    If 13th on a Spectrum (around 1983) now maybe 40 something. But this does not have to do with the attitude. Either you have it or not.

    Being polite is a way of life.

    Anyway, I do respect every member of this forum, but some deserve a little extra like Melanie.

    Did not got exactly all the answers? Why not re-ask? No hurt. Blaiming for un-helpful and no-one is going to help in the future. Why bother? Our time is precious besides...

    1. Set up is fine.

    2. You got it. But consider to use (if you don't) the Usart for most efficient way to send receive data and also interrupts (look for DT-INTS on the forum).

    3. As stated a resistive voltage divider is all that is needed. Simple ohms law to find the values according to your Vin/Vout needs.

    Ioannis

  10. #10
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by scalerobotics View Post
    Perhaps you should stick with the advice given in the first reply, and use the search tools you were offered instead.

    I'm with Joe, I would have guessed 16. 27? Really?
    I dunno, maybe he thought the Google link was the standard Google and not a PICBASIC custom link, I was guessing 17, really what adult talks about their code exploits at 13 anyway? Usually I test the code and pour over the data sheets, didn't have time, but I know everything HE is looking for is here already. Keep handin' out those fish Ioannis, I am sure the recipients appreciate them. Maybe YOU CAN impress him. , funny, I never even thought of trying to impress anybody,incidentally, to everyone who has EVER Tried to help me, Thank You.
    JS
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  11. #11


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Joe S. View Post
    ...really what adult talks about their code exploits at 13 anyway?
    ... the ones that have been programming for fun since an early age and know a few languages...

    As for atitude, as i allready said, i'm considerd a pro or expert or guru in various other forums and i'd be ashamed of myself if i answerd a newby's question like that...

    Quote Originally Posted by Ioannis
    Did not got exactly all the answers? Why not re-ask? No hurt. Blaiming for un-helpful and no-one is going to help in the future. Why bother? Our time is precious besides...

    1. Set up is fine.

    2. You got it. But consider to use (if you don't) the Usart for most efficient way to send receive data and also interrupts (look for DT-INTS on the forum).

    3. As stated a resistive voltage divider is all that is needed. Simple ohms law to find the values according to your Vin/Vout needs.

    Ioannis
    Ioannis, thank you, direct answer saves time...

    I'd actually ruled out using a resister type voltage devider for the reason that it draws curent from the source your measuring... I had thaught of an opamp or another type of amplifier...


    What i'm intensly looking at and trying to resolve is a little problem i seem to have with the data coming out of both hardware and software comm ports in oshonsoft's PIC simulator IDE... dispite having Baud, stop bit and parity correct I regularly get glifs coming out of the ports... but the two ports have gilfs in diferent places... and the software port reciever is reporting stop bit errors????? weird... must be a config error somewhere, thinking about it, I wonder if stop bit/parity is set to none if pic's allow it... meh, i'f sure it's a conf error, i'll find it...

    Thanks to...
    Ioannis & Dave

    Also, I think the PBP way of handling interupts is stupid... you should be allowed to write interupt handlers in PB without PBP inserting all that extra code...

    X

  12. #12
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    comwarrior, I have never seen in my 40+ years of hardware where you would have a start bit and no stop bit.. I would check the frequency being sent to the baudrate generator (clock) and see if it needs some adjustment..

    Dave Purola,
    N8NTA

  13. #13
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,133


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by comwarrior View Post
    I'd actually ruled out using a resister type voltage devider for the reason that it draws curent from the source your measuring... I had thaught of an opamp or another type of amplifier...
    Then use higher value resistors (Mohms) and a suitable opamp as an unity gain buffer, like the LMC662 series (rail to rail).


    Quote Originally Posted by comwarrior View Post
    Also, I think the PBP way of handling interupts is stupid... you should be allowed to write interupt handlers in PB without PBP inserting all that extra code...
    Read my post again. Answer is DT-INTS. It has nothing to do with PBP interrupts. Credits go to Darrel Taylor for his great contribution. Look also his site www.pbpgroup.com for the software.

    Ioannis

    P.S. I still have that old ZX Spectrum and Zeus assembler. What days was those...

Similar Threads

  1. SMS via pic
    By kenandere in forum GSM
    Replies: 15
    Last Post: - 10th March 2010, 10:00
  2. pic to pic ir link versus wired link : help please anyone
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 30th May 2008, 21:01
  3. PIC16F877A - Timer0 won't interrupt
    By WishMaster^ in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 25th April 2007, 08:25
  4. calibration clock 12f508
    By volcane in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th December 2006, 10:33
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts