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

    dont know, I am using this programmer:

    http://www.olimex.com/dev/pic-mcp-usb.html

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    dont know, I am using this programmer:

    http://www.olimex.com/dev/pic-mcp-usb.html
    Move the serial input port on the receiver from RB3 to RB2 and change the program as required.

  3. #3
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    nothing, i tried that before, acually I tried all the ports (B), same thing.

    k

  4. #4
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    nothing, i tried that before, acually I tried all the ports (B), same thing.

    k


    Post your receiver code again (since I think we can assume that the transmitter side is working fine)

    and try switching to t2400 on the receiving side for the heck of it. If it doesn't work, change it back.
    Last edited by skimask; - 24th December 2006 at 02:02.

  5. #5
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    I took a picture of both circuit
    receiving on the left
    http://www3.sympatico.ca/lerameur/

    its the exacte code you gave me :

    'RECEIVE
    INCLUDE "modedefs.bas"
    DEFINE OSC 20 'use external 20mhz crystal
    CMCON = 7 : ANSEL = 0 : ADCON1 = 7
    DEFINE LCD_DREG PORTA ' Set LCD Data port
    DEFINE LCD_DBIT 0 ' 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

    'try1 = count of times waiting for bytes, try2 = count of bytes received
    try1 var byte : try2 var byte : temp var word : tempf var word : input portb.3 : pause 2500

    loop:
    lcdout $fe , $c0 , "Waiting..." , DEC3 try1 , "," , DEC3 try2
    try1 = try1 + 1
    serin portB.3 , n2400 , 1000 , loop , [ temp.highbyte , temp.lowbyte , tempf.highbyte , tempf.lowbyte ]
    try2 = try2 + 2
    lcdout $fe , $c0 , "Received.." , DEC3 try1 , "," , DEC3 try2
    lcdout $fe , $c0 , "Displaying" , DEC3 try1 , "," , DEC3 try2
    lcdout $fe , $80 , "Tc=" , DEC temp , "C,Tf=" , DEC tempf , ".."
    lcdout $fe , $c0 , "Displayed." , DEC3 try1 , "," , DEC3 try2
    goto loop
    End
    Last edited by lerameur; - 24th December 2006 at 02:14.

  6. #6
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    I took a picture of both circuit
    receiving on the left
    http://www3.sympatico.ca/lerameur/

    its the exacte code you gave me :

    'RECEIVE
    INCLUDE "modedefs.bas"
    DEFINE OSC 20 'use external 20mhz crystal
    CMCON = 7 : ANSEL = 0 : ADCON1 = 7
    DEFINE LCD_DREG PORTA ' Set LCD Data port
    DEFINE LCD_DBIT 0 ' 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

    'try1 = count of times waiting for bytes, try2 = count of bytes received
    try1 var byte : try2 var byte : temp var word : tempf var word : input portb.3 : pause 2500

    loop:
    lcdout $fe , $c0 , "Waiting..." , DEC3 try1 , "," , DEC3 try2
    try1 = try1 + 1
    serin portB.3 , n2400 , 1000 , loop , [ temp.highbyte , temp.lowbyte , tempf.highbyte , tempf.lowbyte ]
    try2 = try2 + 2
    lcdout $fe , $c0 , "Received.." , DEC3 try1 , "," , DEC3 try2
    lcdout $fe , $c0 , "Displaying" , DEC3 try1 , "," , DEC3 try2
    lcdout $fe , $80 , "Tc=" , DEC temp , "C,Tf=" , DEC tempf , ".."
    lcdout $fe , $c0 , "Displayed." , DEC3 try1 , "," , DEC3 try2
    goto loop
    End
    The picture at the site is messed up. Scale it down or something.
    Have you tried switching the pins/code over to RB2?
    Have you tried changing the receiver to t2400?

    Change
    serin portB.3 , n2400 , 1000 , loop , [ temp.highbyte , temp.lowbyte , tempf.highbyte , tempf.lowbyte ]

    to
    serin portB.2 , n2400 , 100 , loop , [ temp.highbyte , temp.lowbyte , tempf.highbyte , tempf.lowbyte ]

    Now you should see try1 increment fast, like 10 times per second.
    Wait on it for a couple of minutes. If it only increases about once a minute or so, something is wrong with your oscillator, it's running on the internal backup failsafe oscillator.

    I thought you said DEC3 doesn't work?
    Last edited by skimask; - 24th December 2006 at 02:33.

  7. #7
    Join Date
    Sep 2006
    Posts
    747


    Did you find this post helpful? Yes | No

    Default

    the site is ok now,

    the counter goes up ten times as fast

    I change to t2400 and n 2400 , no change,

    bth crytals are clocking 20 Mhz,

    also I have been swaping pic, i am using 2 pic16f88, so they can be both ****ed up, and I have a third one, with no change,
    I just tried a brand new pic88, no changes, i swapped the crytals between the two circuits too!

    I thought you said DEC3 doesn't work? yes I thought, it was because try2 was not initialized, and it happend only where dec3 was, . The other program was compiling
    Last edited by lerameur; - 24th December 2006 at 02:41.

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by lerameur View Post
    the site is ok now,

    the counter goes up ten times as fast

    I change to t2400 and n 2400 , no change,

    bth crytals are clocking 20 Mhz,

    also I have been swaping pic, i am using 2 pic16f88, so they can be both ****ed up, and I have a third one, with no change,
    I just tried a brand new pic88, no changes, i swapped the crytals between the two circuits too!

    I thought you said DEC3 doesn't work? yes I thought, it was because try2 was not initialized, and it happend only where dec3 was, . The other program was compiling
    What is that big yellow wire for? The one that looks like it's going over the top of the picture? Either that or zoom back out just a little bit more for your picture....

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