Serial comunication problem


Closed Thread
Results 1 to 23 of 23

Hybrid View

  1. #1
    Join Date
    Oct 2004
    Posts
    448


    Did you find this post helpful? Yes | No

    Default Re: Serial comunication problem

    Are you adding the '#' before the variable?

    And if you are using the built-in oscillator on the 16F676, are you sure your OSCCAL value is correct?

    Regards,

    Anand

  2. #2
    Join Date
    Sep 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Serial comunication problem

    Firs one thanks to all for fast answer.
    Yes I have checked all things posted and a lot of times.
    But nothing work.

    Maybe is a problem with a Breadboard thet collect noise ?

    I know it hard to say what check, but all seem fine and at
    same time nothing work!

    I am very confused because I have made a lot o circuit
    with PIC in assembler and basic, with motor, with display,
    with PWN dimmed ligght, and ever have worked fine,
    but now with a silly serial debugging purpose nothing
    work.
    I am very frustated!
    Last edited by synsyn; - 30th September 2011 at 21:01.

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: Serial comunication problem

    Post you code and configs along with a schematic.
    Everyone is guessing as is.
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Sep 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Serial comunication problem

    Hello,
    Thank for reply and sorry for the late to answer but I was away for job.

    I don't have much to to make experiment but I have try to change the
    cable and the main circuit.
    All is same I will get back the same garbage but...

    Now i try to send the word "Hello" and now I get back on screen PC the
    exact number of chars but with non ascii format like '¨µ¼´¿".

    Yesterday I don't know how, maybe some change to prog or same hack
    on circuit, for a short time I have get back the correct string on screen!
    "hello"hello"hello"...

    After that I have made some change and now all is come back in the
    same garbage!

    In anyway this is the source:
    ------------------------------------------------------------------------------
    ANSEL=0
    CMCON=7



    TRISA = %11110000 ' Set PORTA to all input
    TRISC = %00000000 ' Set PORTA to all input


    Include "modedefs.bas"

    DEFINE OSC 4

    DEFINE DEBUG_REG PORTC
    DEFINE DEBUG_BIT 1
    DEFINE DEBUG_BAUD 2400
    DEFINE DEBUG_MODE 0

    DEFINE DEBUG_PACING 1000

    Clear
    Pause 1000

    Cont var Byte

    Cont = 0
    Mainloop
    PAUSE 1000
    Cont = Cont + 1
    Debug "Hello"
    PORTC.2 = 1
    PAUSE 1000
    PORTC.2 = 0
    goto Mainloop
    ------------------------------------------------------------------------------
    And this the circuit:

    Name:  Scheme.JPG
Views: 708
Size:  40.3 KB

  5. #5
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: Serial comunication problem

    I see you have a LED set to blink on for 1 sec, then off for 1 sec. Is the LED blinking and at the correct speed?
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  6. #6
    Join Date
    Sep 2011
    Posts
    20


    Did you find this post helpful? Yes | No

    Default Re: Serial comunication problem

    Hi Bert,

    I have fogot to say, it is only a luminose control to see if all work well(I don't have put it on the scheme).
    And yes it seem blink 1 sec and 1 sec no. It's hard to say just lookin at it
    but the time seem correct yes.

  7. #7
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: Serial comunication problem

    Well that would seem to rule out any OSC issues. The Pic is running and running at 4Mhz as you have programmed for. At this point, I think I would just have it run and start touching stuff. Maybe there is a breadboard problem or something like that. If it worked yesterday, even just for a few times, it seems like the code is good. So the only thing left is hardware.

    Wiggle the caps while watching the PC to see if "hello" magically appears. also all the wires. Do this 1 at a time to try and isolate the problem.

    Maybe even try a different output pin, Or move the parts around on the BB. I have had BB's fail on a pin here and there from the socket not making good contact.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

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