Serin serout problem


Closed Thread
Results 1 to 40 of 337

Hybrid View

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

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

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

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

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

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

  7. #7
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    led on RC3,.. do not work

    @ 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

    INCLUDE "modedefs.bas"

    DEFINE LCD_DREG PORTC ' 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

    TRISC =0

    Pause 1000 ' Wait 1 second

    loop:

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

    portc.3=0
    portc.3=1
    pause 300
    portc.3=0

    goto loop

    end

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    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
    DEFINE OSC 20 is for PBP and it's internal compiler and setting up various timing loops; it doesn't set any config bits anywhere in the PIC.

    Leave both in there.

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