pic telemetry system


Closed Thread
Results 1 to 24 of 24

Hybrid View

  1. #1
    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...

  2. #2


    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...

  3. #3
    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.

  4. #4


    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...

  5. #5
    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

  6. #6
    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!)

  7. #7
    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

  8. #8
    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

  9. #9
    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.

  10. #10


    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

  11. #11
    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

  12. #12
    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...

  13. #13


    Did you find this post helpful? Yes | No

    Default

    ok, i see what your saying for interupt handling and i'll read more when i get fedup trying to sort the comms out...

    here is a little test program i've done to try and debug the problem with the serial comms...

    Code:
    include "modedefs.bas"
    include "bs1defs.bas"
    Define CONF_WORD = 	0x3d71
    Define  OSC				4				' Set clock speed
    
    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
    
    SPBRG = 25              ' Set baud rate to 2400
    RCSTA = %10010000       ' Enable serial port and continuous receive
    TXSTA = %00100000       ' Enable transmit and asynchronous mode
    
    RCSTA = %10010000       ' Enable serial port and continuous receive
    TXSTA = %00100000       ' Enable transmit and asynchronous mode
    
    ADT1 var word							' Create ADT1 to store curent ad conversion for AD channel 0
    ADT2 var word                   		' Create ADT2 to store curent ad conversion for AD channel 1
    ADT1MAX var word						' Create ADT1MAX to store curent ADC0 max val
    ADT1MAX = 0
    ADT2MAX var word						' Create ADT2MAX to store curent ADC1 max val
    ADT2MAX = 0
    ADT1VAL var word
    ADT1VAL = 0
    ADT2VAL var word
    ADT2VAL = 0
    ADV1 var word
    
    TRISE = 255							' Set PortE to all inputs
    TRISD = 0							' Set PortD to all outputs
    TRISC = 0							' Set PortC to all outputs
    TRISB = 0							' Set PortB to all outputs
    TRISA = 255 						' Set PORTA to all input
    ADCON1 = 0 							' PORTA is analog
    
    HSEROUT [" initialised",10,13]
    SEROUT PORTB.1,t9600,[" initialised",10,13]
    
    Loop:
    ADCIN 0, ADT1
    HSEROUT [DEC5 ADT1,10,13]
    SEROUT PORTB.1,t9600,[#ADT1,10]
    goto Loop
    end
    From software UART i get...

    Code:
    +¥ֻ±Í•´
    0
    0
    software uart output is reporting incorrect stop bits when it sends the "initialising" stream...

    I should re-point out, i'm experimenting in a PIC simulator untill i get the right output...
    i have a pair of 16F877's due to arive tomarow and JDM programmer and max232 converts (serial and USB versions) due to arive at any time...

    I know i've not included the half second pause for ADC...
    so, what have i missed out from my initialisations?

    Thanks

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