Serin serout problem


Closed Thread
Results 1 to 40 of 337

Hybrid View

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

  2. #2
    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 19:54.

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

  4. #4
    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 20:21.

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

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

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

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

Similar Threads

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