Serin serout problem - Page 6


Closed Thread
Page 6 of 9 FirstFirst ... 23456789 LastLast
Results 201 to 240 of 337
  1. #201
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    HI I did the test , as I suspected, I get 0.7v all the time. So I caould put a few in a row to get a higher voltage difference and use that as a reference voltage.

  2. #202
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    HI I did the test , as I suspected, I get 0.7v all the time. So I caould put a few in a row to get a higher voltage difference and use that as a reference voltage.
    You could, but those diodes will vary in voltage with time, temperature, current flow, moon phases, etc, not by much, but they will change over time and temperature at least, and in series, they'd do nothing but get worse. Therefore, you're battery voltage reading will change accordingly, and probably screw you up in the long run. And you have to have X amount of current to even get the diodes to conduct. You might end up using more power than you would really want to just to get a reading.

    Have you been able to get the A/D working yet?
    Like I said, spare pin to a resistor (probably 1K or so), other side of resistor to non-banded side of diode, banded side of diode to ground. Tap the non-banded side to your A/D port and take some readings with the battery hooked up as normal and A/D converter set up with Vref+ at Vdd and Vref- at Vss. If you're using the 10bit A/D, you should get a reading arorund 150-ish. Then as the battery wears down, the reading will go up. A reading of roughly 200 will mean a dead battery.

    And, you can save the power to read the battery by change that 'spare pin' mentioned above to an input and shutting off the A/D module.

  3. #203
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    ok , I have a problem now:

    i wrote this program below, I configured so it read porta.0, but I get 0 output when I ground it and oscillation between 890 and to 900 when i put it to Vdd.
    if I leave the program as is, and just put the input wire to portA.1 theni get 0 output when i groud the wire, and 1023 when I put it to Vdd.
    Why am I getting a better result to a non configured port 6, at least i am ot calling this pin ??
    my ADCON0 = %10000001 i believe this is for An0 to input
    I am also trying to get two input for A/d , is that possible ?

    'RECEIVE PIC
    INCLUDE "modedefs.bas"


    DEFINE OSC 20 'use external 20mhz crystal
    DEFINE LCD_DREG PORTB ' Set LCD Data port
    DEFINE LCD_DBIT 4 ' Set starting Data bit (0 or 4) if 4-bit bus
    DEFINE LCD_RSREG PORTB ' Set LCD Register Select port
    DEFINE LCD_RSBIT 1 ' Set LCD Register Select bit
    DEFINE LCD_EREG PORTB ' Set LCD Enable port
    DEFINE LCD_EBIT 0 ' Set LCD Enable bit
    DEFINE LCD_BITS 4 ' Set LCD bus size (4 or 8 bits)
    DEFINE LCD_LINES 2 ' Set number of lines on LCD
    DEFINE LCD_COMMANDUS 2500
    'DEFINE LCD_DATAUS 250
    'DEFINE CHAR_PACING 2000
    pause 1000

    ' Define ADCIN parameters
    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

    input1 var word : input2 var word

    TRISA = %11111111 ' Set PORTA to all input
    CMCON = 7
    ANSEL = %00001100
    ADCON1 = %10000010
    ADCON0 = %10000001

    Pause 500

    loop: ADCIN porta.0, input1

    Lcdout $fe, 1 ' Clear LCD
    Lcdout "Value1: ", DEC input1 ' Display the decimal value
    lcdout $FE,$C0, "Value2: ", dec input2
    Pause 200

    Goto loop
    End


    Also, what do you mean by : Spare pin to resistor ?
    Last edited by lerameur; - 3rd January 2007 at 00:32.

  4. #204
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    trying to get multiple input,but getting wrong values


    loop:
    ADCON0 = %10000001 ' Configure and turn on A/D Module
    ADCIN porta.0, input1
    pause 50

    ADCON0 = %10001001 ' Configure and turn on A/D Module
    ADCIN porta.1, input2
    pause 50

    Lcdout $fe, 1 ' Clear LCD
    Lcdout "Value1: ", DEC input1 ' Display the decimal value
    lcdout $FE,$C0, "Value2: ", dec input2
    Pause 400

    Goto loop

  5. #205
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    ok , I have a problem now:

    i wrote this program below, I configured so it read porta.0, but I get 0 output when I ground it and oscillation between 890 and to 900 when i put it to Vdd.
    if I leave the program as is, and just put the input wire to portA.1 theni get 0 output when i groud the wire, and 1023 when I put it to Vdd.
    Why am I getting a better result to a non configured port 6, at least i am ot calling this pin ??
    my ADCON0 = %10000001 i believe this is for An0 to input
    I am also trying to get two input for A/d , is that possible ?

    'RECEIVE PIC
    INCLUDE "modedefs.bas"


    DEFINE OSC 20 'use external 20mhz crystal
    DEFINE LCD_DREG PORTB ' Set LCD Data port
    DEFINE LCD_DBIT 4 ' Set starting Data bit (0 or 4) if 4-bit bus
    DEFINE LCD_RSREG PORTB ' Set LCD Register Select port
    DEFINE LCD_RSBIT 1 ' Set LCD Register Select bit
    DEFINE LCD_EREG PORTB ' Set LCD Enable port
    DEFINE LCD_EBIT 0 ' Set LCD Enable bit
    DEFINE LCD_BITS 4 ' Set LCD bus size (4 or 8 bits)
    DEFINE LCD_LINES 2 ' Set number of lines on LCD
    DEFINE LCD_COMMANDUS 2500
    'DEFINE LCD_DATAUS 250
    'DEFINE CHAR_PACING 2000
    pause 1000

    ' Define ADCIN parameters
    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

    input1 var word : input2 var word

    TRISA = %11111111 ' Set PORTA to all input
    CMCON = 7
    ANSEL = %00001100
    ADCON1 = %10000010
    ADCON0 = %10000001

    Pause 500

    loop: ADCIN porta.0, input1

    Lcdout $fe, 1 ' Clear LCD
    Lcdout "Value1: ", DEC input1 ' Display the decimal value
    lcdout $FE,$C0, "Value2: ", dec input2
    Pause 200

    Goto loop
    End


    Also, what do you mean by : Spare pin to resistor ?


    Oscillation - I get that too on most everything I do on the A/D inputs (I don't know if it's a function of crappy circuit boards or bad design, doesn't matter to me anyways). You're probably going to want to do some sort of software averaging and/or put a capacitor across the input line to smooth it out a bit.

    Spare pin on resistor - instead of putting the diode direct to battery power, thru a resistor to ground, you can intermittently power that diode thru a spare PIC output pin and save that power. Every little bit helps ya know.

  6. #206
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    ok, but what about this loop here, can i do that, having multiple a/d conversion on one chip ?

    loop:
    ADCON0 = %10000001 ' Configure and turn on A/D Module
    ADCIN porta.0, input1
    pause 50

    ADCON0 = %10001001 ' Configure and turn on A/D Module
    ADCIN porta.1, input2
    pause 50

    From the definition of ADCON0, I can only choose one pin for A/D conversion. Maybe thats why it get mixed up .
    Last edited by lerameur; - 3rd January 2007 at 20:39.

  7. #207
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    ok, but what about this loop here, can i do that, having multiple a/d conversion on one chip ?

    loop:
    ADCON0 = %10000001 ' Configure and turn on A/D Module
    ADCIN porta.0, input1
    pause 50

    ADCON0 = %10001001 ' Configure and turn on A/D Module
    ADCIN porta.1, input2
    pause 50

    From the definition of ADCON0, I can only choose one pin for A/D conversion. Maybe thats why it get mixed up .
    You can do A/D on more than one pin, just not at the same time. I'm not sure why it didn't work for you in the one post. Maybe not waiting long enough between conversions and/or long enough between switching A/D channel assignment. I think you have to wait awhile, not only after the last conversion, but after you switch the channel, which ADCIN does for you. So, again, not sure. I'll think on it. Until then, double check your configuration, TRIS assignments, ADCON setup, etc.etc.
    And you shouldn't have to use more than one channel for your project, unless I missed something there too...

  8. #208
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    HI,
    I dont have to use more then one for this project, But I had this problem before and did not persue into it, so I asked the question just on the way. I read on a site, just like you said, adding a capacitor to the output of the sensor or battery will help. The thing I dont know why it works, I tried these two program they both works, just dont know why the program with just one ADCON0 works

    Two Adcon
    ADCON0 = %10000001 ' Configure and turn on A/D Module
    ADCIN porta.0, input1
    pause 50

    ADCON0 = %10001001 ' Configure and turn on A/D Module
    ADCIN porta.1, input2
    pause 50


    One ADCON0
    ADCON0 = %10000001 ' Configure and turn on A/D Module
    ADCIN porta.0, input1
    ADCIN porta.1, input2
    pause 50

    See they both work, but I did not configure port A.1.. why ?

  9. #209
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    HI,
    I dont have to use more then one for this project, But I had this problem before and did not persue into it, so I asked the question just on the way. I read on a site, just like you said, adding a capacitor to the output of the sensor or battery will help. The thing I dont know why it works, I tried these two program they both works, just dont know why the program with just one ADCON0 works

    Two Adcon
    ADCON0 = %10000001 ' Configure and turn on A/D Module
    ADCIN porta.0, input1
    pause 50

    ADCON0 = %10001001 ' Configure and turn on A/D Module
    ADCIN porta.1, input2
    pause 50


    One ADCON0
    ADCON0 = %10000001 ' Configure and turn on A/D Module
    ADCIN porta.0, input1
    ADCIN porta.1, input2
    pause 50

    See they both work, but I did not configure port A.1.. why ?
    You're using the ADCIN command. Ya think maybe PBP sets it up for ya?
    I know the PBP manual doesn't explicitly say it that it sets it up for you, but it does say that ADCIN reads the 'channel' and also says all you have to do is set the required pins to inputs, it doesn't really say to select the channel you want to sample... I suppose the manual could be a little more informative in this respect.
    I just looked at the ADC section of the 'F88. It's a bit different than some of the other PICs. Not only do you have to TRIS the pins you want to inputs, but you also have to enable the A/D in the ANSEL register. I don't know if PBP does this for you or not.
    You can easily check for that in your .lst file after compiling the program. Just put a comment around the line you're wanting to check and search for that comment in the .lst file. Should make it a bit easier for ya...

  10. #210
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    hi,

    Ok I got the A/D working now.

    I bought another RF module kit from this web site:
    http://www.robotshop.ca/home/product...ity-tx-rx.html
    ( actuallyI just had to drive there).
    I use the exact program and configuraiton and I am getting contact output on the lcd :
    TempC : 0
    TempF: 32

    here is what I see on the scope:
    http://www3.sympatico.ca/lerameur/
    Last edited by lerameur; - 4th January 2007 at 17:27.

  11. #211
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    hi,

    Ok I got the A/D working now.

    I bought another RF module kit from this web site:
    http://www.robotshop.ca/home/product...ity-tx-rx.html
    ( actuallyI just had to drive there).
    I use the exact program and configuraiton and I am getting no ouput
    here is what I see on the scope:
    http://www3.sympatico.ca/lerameur/
    A/D is working as expected? Values are what you need and all that?

    RF Modules - sounds like you should take them back and get another pair of the same thing you've already got.

  12. #212
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    I bought three pair of them , They all act the same...
    it looks ok from the scope doesn't it ??

    A/D is working as expected? Values are what you need and all that?
    Yes
    Last edited by lerameur; - 4th January 2007 at 17:49.

  13. #213
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    I bought three pair of them , They all act the same...
    it looks ok from the scope doesn't it ??

    A/D is working as expected? Values are what you need and all that?
    Yes
    Put the old ones back in and snap a pic of those, put the 2 pic's up side by side. Maybe one is inverted from the other or something.

  14. #214
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    I did that they are almost the same on the scope.

  15. #215
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    I did that they are almost the same on the scope.
    Almost apparently isn't close enough.
    Fatten up the traces a bit if you can and repost the pics including the original RF module sets.
    Also, you might want to try speeding up the TX rate, maybe a couple more sync bytes ($55), maybe less, who knows.
    That's the problem with getting something to work with one thing, and then using another, you gotta redo practically everything.

  16. #216
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    Ok I posted a picture of the working module, I bit different.
    same link

  17. #217
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    Ok I posted a picture of the working module, I bit different.
    same link
    2nd picture, bottom trace is old 'working' receiver output?

    If so, do you see that big gap after every transmission? That's the data slicer slowly losing it's mind. After a couple of ms, it starts going nuts, which is why you have to train the rx.

    If I had to guess, I would say try using n2400 (or t2400, I don't remember which) instead of what you're using now, on both TX and RX. Then try t2400 on the TX and n2400 on the RX. It (the new TX/RX pair) looks like it's inverted or something.
    And again, try bumping up the speed. On the new RX 'scope picture, see how that gap isn't there? That thing loses it's mind fast.

  18. #218
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    Ok i tried faster speed, and same thing, I changed to t2400 here si the result, it looks good, but the output gives me
    tempc: -6396C
    tempf: -60 F

    3rd pic:
    http://www3.sympatico.ca/lerameur/

    It also take like 15 seconds before anything appears on the lcd.
    whereas before a few seconds

    Then try t2400 on the TX and n2400 on the RX.
    output is now:
    tempc: +148C
    tempf: +99.75 F
    and it does not seem to be moving from that

    i did all the test with all three set of TX and RX modules, same results with each

    these modules has to be working, the only difference is the white space is a bit smaller.. unless it means the chip is useless. Should i order other fron Rentron ?
    Last edited by lerameur; - 4th January 2007 at 19:21.

  19. #219
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    Ok i tried faster speed, and same thing, I changed to t2400 here si the result, it looks good, but the output gives me
    tempc: -6396C
    tempf: -60 F

    3rd pic:
    http://www3.sympatico.ca/lerameur/

    It also take like 15 seconds before anything appears on the lcd.
    whereas before a few seconds

    Then try t2400 on the TX and n2400 on the RX.
    output is now:
    tempc: +148C
    tempf: +99.75 F
    and it does not seem to be moving from that

    i did all the test with all three set of TX and RX modules, same results with each

    these modules has to be working, the only difference is the white space is a bit smaller.. unless it means the chip is useless. Should i order other fron Rentron ?

    How about n2400 on TX and t2400 on RX?
    Try 1200 or 300 yet?

    Order from Rentron - I would stick with what works, or at least what has worked in the past rather than trying something new.

  20. #220
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    SLAP me with a dead fish in the face....
    I have crystals in drawers, Ithoight they where 20Mhz, they where 2.0 Mhz...
    it works now...

  21. #221
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    SLAP me with a dead fish in the face....
    I have crystals in drawers, Ithoight they where 20Mhz, they where 2.0 Mhz...
    it works now...
    Go figure And that would explain why the traces were so different in width at the same time scale on the 'scope.

  22. #222
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    I am attempting to use the encoder I received a while ago to compare with my software encoding technique. see new thread

    k

  23. #223
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    I am going to start my other project which needs two HPWM port, so I choose the pic16F876 for now, I cannot make it oscillate, you have idea, is there a software (programming thing ) that is needed ? I read the spec sheet i didnot see anything about it

  24. #224
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    I am going to start my other project which needs two HPWM port, so I choose the pic16F876 for now, I cannot make it oscillate, you have idea, is there a software (programming thing ) that is needed ? I read the spec sheet i didnot see anything about it
    Have you got PGM (RB4? RB5?) pulled up or down, whichever it is?
    The '876 is practically the same as the '877, I don't remember any tricks for it, just make sure you xtal config bits are set right (should be HS I would think).

  25. #225
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    I am attempting to use the encoder I received a while ago to compare with my software encoding technique. see new thread

    k
    I saw that. Some (most?) of them won't do data. They'll do a single switch position on the TX end, to a single relay/light/whatever on the RX end.

    That's why I pushed the manchester encoding so hard a couple of weeks ago. You know what you're doing now (I think anyways, you got the temperature to transmit without it didn't you?) and don't need those encoders.

  26. #226
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    SLAP me with a dead fish in the face....
    I have crystals in drawers, Ithoight they where 20Mhz, they where 2.0 Mhz...
    it works now...
    Speaking of slapping yourself in the dead face with a fish
    Just now I couldn't get my PIC to run...I had the oscillator in there backwards...3 hours down the tubes...datasheets show it upside-down

  27. #227
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    hehehe, yes well that 2.0 Mhz crystals cost some hours too Grrrrr

    Manchester encoding is working good. I also saw on previous post that other where trying to remove errors in the transmition so the wireless could be almost full proof. I saw the shiftin function was used in one case.

    When I ordered these encoders, , I did not know there was different types of encoding (serial , parallel). Maybe one day I will find use for them.
    k

  28. #228
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    xtal config bits ?

    isn't it this line I had in my code:
    DEFINE OSC 20 'use external 20mhz crystal

    Do I need to add this line too ?
    @ DEVICE PIC16F877,HS_OSC ' Use PIC16F877 and HS Oscilator

    Why didn,t i need to add this when using the pic16F88??
    Last edited by lerameur; - 5th January 2007 at 18:54.

  29. #229
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    xtal config bits ?

    isn't it this line I had in my code:
    DEFINE OSC 20 'use external 20mhz crystal
    Nope, that DEFINE just tells PBP what sort of timing to use when it compiles. For example, if you defined 4mhz, a pause 1000 would have x number of delay statements (or loops or whatever). If you define 20mhz, PBP will automatically change that X number to 5 times the number of delay statements (or loops or whatever). The real explanation is towards the end of the PBP manual.

    For checking your xtal config bits, you'll either want to check you programmer's config bit settings (which you'd probably do right before you hit the program button), or start adding config lines in your code.
    For example, here's a bit (ok, actually it's all of them plus explanations below it of what each register does and how to use it) of config's for one of my projects using a PIC18F4620:

    @ __CONFIG _CONFIG1H, _OSC_HSPLL_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
    @ __CONFIG _CONFIG2L, _BOREN_OFF_2L & _PWRT_ON_2L
    @ __CONFIG _CONFIG2H, _WDT_OFF_2H & _WDTPS_32768_2H
    @ __CONFIG _CONFIG3H, _LPT1OSC_OFF_3H & _MCLRE_ON_3H & _PBADEN_OFF_3H & _CCP2MX_PORTC_3H
    @ __CONFIG _CONFIG4L, _XINST_OFF_4L & _STVREN_OFF_4L & _LVP_OFF_4L & _DEBUG_OFF_4L

    @ __CONFIG _CONFIG5L, _CP0_OFF_5L & _CP1_OFF_5L & _CP2_OFF_5L & _CP3_OFF_5L
    @ __CONFIG _CONFIG5H, _CPB_OFF_5H & _CPD_OFF_5H
    @ __CONFIG _CONFIG6L, _WRT0_OFF_6L & _WRT1_OFF_6L & _WRT2_OFF_6L & _WRT3_OFF_6L
    @ __CONFIG _CONFIG6H, _WRTC_OFF_6H & _WRTB_OFF_6H & _WRTD_OFF_6H
    @ __CONFIG _CONFIG7L, _EBTR0_OFF_7L & _EBTR1_OFF_7L & _EBTR2_OFF_7L & _EBTR3_OFF_7L
    @ __CONFIG _CONFIG7H, _EBTRB_OFF_7H

    ;----- CONFIG1H Options --------------------------------------------------
    ;_OSC_LP_1H,_OSC_XT_1H,_OSC_HS_1H,_OSC_RC_1H,_OSC_ EC_1H,_OSC_ECIO6_1H,_OSC_HSPLL_1H,_OSC_RCIO6_1H,_O SC_INTIO67_1H,_OSC_INTIO7_1H,_FCMEN_OFF_1H,_FCMEN_ ON_1H,_IESO_OFF_1H,_IESO_ON_1H

    ;----- CONFIG2L Options --------------------------------------------------
    ;_PWRT_ON_2L, _PWRT_OFF_2L, _BOREN_OFF_2L, _BOREN_ON_2L, _BOREN_NOSLP_2L, _BOREN_SBORDIS_2L, _BORV_0_2L, _BORV_1_2L, _BORV_2_2L, _BORV_3_2L

    ;----- CONFIG2H Options --------------------------------------------------
    ;_WDT_OFF_2H, _WDT_ON_2H, _WDTPS_ 1 / 2 / 4 / 8 / 16 / 32 / 64 / 128 / 256 / 512 / 1024 / 2048 / 4096 / 8192 / 16384 / 32768 _2H

    ;----- CONFIG3H Options --------------------------------------------------
    ;_MCLRE_OFF_3H, _MCLRE_ON_3H, _LPT1OSC_OFF_3H, _LPT1OSC_ON_3H, _PBADEN_OFF_3H, _PBADEN_ON_3H, _CCP2MX_PORTBE_3H, _CCP2MX_PORTC_3H

    ;----- CONFIG4L Options --------------------------------------------------
    ;_STVREN_OFF_4L, _STVREN_ON_4L, _LVP_OFF_4L, _LVP_ON_4L, _XINST_OFF_4L, _XINST_ON_4L, _DEBUG_ON_4L, _DEBUG_OFF_4L

    ;------CONFIG5/6/7 Options not used for code/eeprom protection

  30. #230
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    where can I get a tutorial on this,
    I checked PBP manual the datasheet of my PIC and I have not seen that. I just want to be able to read what you posted,
    1H, 2L 2H etc.. no idea, (and the rest too)
    hennnn I feel pretty stupid now

    I saw that this is in the file included in the PBP compiler, like INCLUDE "P16F877A.INC"
    Last edited by lerameur; - 5th January 2007 at 19:21.

  31. #231
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    where can I get a tutorial on this...
    Here is a good starting place: Presetting Configuration Fuses (PIC Defines) into your Program

  32. #232
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    where can I get a tutorial on this,
    I checked PBP manual the datasheet of my PIC and I have not seen that. I just want to be able to read what you posted,
    1H, 2L 2H etc.. no idea, (and the rest too)
    hennnn I feel pretty stupid now

    I saw that this is in the file included in the PBP compiler, like INCLUDE "P16F877A.INC"
    Check 'Special Features' section of the datasheet, and 'Presetting Config fuses' link above. That should hook you up with all the info you need. It got me straightened out in a hurry.

  33. #233
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    Ok thanks for the link

    to go back to the A/D conversion.
    I read another way to use analog to digital with direct ADC control, and not with adcin , What does that mean ?

  34. #234
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    Ok thanks for the link

    to go back to the A/D conversion.
    I read another way to use analog to digital with direct ADC control, and not with adcin , What does that mean ?
    Accessing the registers directly, select channel, set pin assignments, set acquisition time, set sampling time, turn module on, start a/d conversion, wait for completion and read the registers.
    Again, if ADCIN is working, stay with it. You won't do a lot better with direct access.

  35. #235
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Yup it's just another way to do the same thing... it's just a little less code hungry
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  36. #236
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    Ok still working on the same pic.

    I finally got the oscillation going.
    I wrote this program: (I have two questions)
    1) why does the DEFINE OSC 20 not work in this case
    2) In the program i wrote, NOTHING appears on the LCD
    Can I put all the ldout pin on the B port ?
    Pin 11 LCD on to PIN 25
    Pin 12 --> Pin 26
    Pin 13 --> Pin 27
    Pin 14 --> Pin 28

    anything software for the lcd that i dont have to do with the Pic 16f88 ?

    @ DEVICE PIC16F876A , HS_OSC , WDT_OFF , PWRT_ON , BOD_ON , LVP_OFF , PROTECT_OFF
    'HS 20mhz, watchdog off, powerup timer on, mclr external, brown out detect on, low volt program off , code protect off

    DEFINE LCD_DREG PORTB ' Set LCD Data port
    DEFINE LCD_DBIT 4 ' Set starting Data bit (0 or 4) if 4-bit bus
    DEFINE LCD_RSREG PORTB ' Set LCD Register Select port
    DEFINE LCD_RSBIT 1 ' Set LCD Register Select bit
    DEFINE LCD_EREG PORTB ' Set LCD Enable port
    DEFINE LCD_EBIT 0 ' Set LCD Enable bit
    DEFINE LCD_BITS 4 ' Set LCD bus size (4 or 8 bits)
    DEFINE LCD_LINES 2 ' Set number of lines on LCD
    DEFINE LCD_COMMANDUS 2500
    DEFINE LCD_DATAUS 250
    DEFINE CHAR_PACING 2000

    Pause 1000 ' Wait 1 second

    loop:

    lcdout $FE,1, "Number: ", dec 55
    pause 100
    goto loop
    end

    Have you got PGM (RB4? RB5?) pulled up or down, whichever it is?
    I use them for my LCDout....
    Last edited by lerameur; - 7th January 2007 at 01:19.

  37. #237
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    Ok still working on the same pic.

    1) why does the DEFINE OSC 20 not work in this case
    2) In the program i wrote, NOTHING appears on the LCD
    Can I put all the ldout pin on the B port ?

    anything software for the lcd that i dont have to do with the Pic 16f88 ?

    end
    1) What do you mean by OSC 20 doesn't work? Compile error? Timing wrong?

    2) yes, you can put the LCD data lines anywhere you CAN define them.
    Did you try an led blink yet?

    PIC16F876A and 16F88 should operate the same as far as PBP is concerned.
    Why not use port D like usual?

  38. #238
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    What do you mean by OSC 20 doesn't work? Compile error? Timing wrong?
    No oscillation on the scope... thast why

    2) yes, you can put the LCD data lines anywhere you CAN define them.
    Did you try an led blink yet?
    I will try it

    PIC16F876A and 16F88 should operate the same as far as PBP is concerned.
    Why not use port D like usual?
    NO port D on that chip, I tried portC 4 to 7 , no difference
    Last edited by lerameur; - 7th January 2007 at 03:11.

  39. #239
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    What do you mean by OSC 20 doesn't work? Compile error? Timing wrong?
    No oscillation on the scope... thast why

    2) yes, you can put the LCD data lines anywhere you CAN define them.
    Did you try an led blink yet?
    I will try it

    PIC16F876A and 16F88 should operate the same as far as PBP is concerned.
    Why not use port D like usual?
    NO por D onthat chip, I tried portC 4 to & , no differnce
    You said in post 236 you got the oscillation going.

    Port D - DOH!!!! I knew that...I was just checking you...yeah that's it, just checking...

  40. #240
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    yes it does oscillate
    when I put thisline:

    @ DEVICE PIC16F876A , HS_OSC , WDT_OFF , PWRT_ON , BOD_ON , LVP_OFF , PROTECT_OFF

    and not:
    DEFINE OSC 20

Similar Threads

  1. A Serial GLCD 128x64 Simple Project
    By Oldspring in forum Off Topic
    Replies: 0
    Last Post: - 8th March 2010, 20:58
  2. PIC16f877 code crosses boundary @800h
    By inventosrl in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th April 2009, 22:03
  3. serout and serin problem
    By nicolelawsc in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th April 2006, 19:44
  4. Replies: 11
    Last Post: - 13th July 2005, 19:26
  5. SerIn and SerOut
    By Dwayne in forum FAQ - Frequently Asked Questions
    Replies: 0
    Last Post: - 21st July 2004, 15:54

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