serial communication time


Closed Thread
Results 1 to 28 of 28

Hybrid View

  1. #1
    Join Date
    Jan 2008
    Location
    Selm, Germany
    Posts
    116


    Did you find this post helpful? Yes | No

    Default serial communication speed? Parrallel communication !

    Hi .
    Ok maybe I´m not software-smart enough to get my data sending/recieving problem as fast as needed.
    So I try to switch to parallel communication.
    I like the instruction:

    PortB = VAR (byte)

    the only problem is the fact that I need Portb.0 for the external interrupt so I will take the PIC16F873 which has more pins. Still need the ZIF socket for my programming adapter.

    I will tell how that works.

    To Skimask:
    yes you are right about your detonation assumptions.
    Know a bit about engines myself : http://www.davidpower.de/fotos_mot.htm

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Mugelpower View Post
    So I try to switch to parallel communication.
    I don't think it's so much serial vs. parallel as it is the fact that you've got to SPEED up the serial quite a bit, which is entirely doable, or switch over to a CAN based type network, which again, with the newer PICs, entirely doable.

    yes you are right about your detonation assumptions.
    Know a bit about engines myself : http://www.davidpower.de/fotos_mot.htm
    Point taken. Looks like a bit of a fun place to work there! Wish I could read German(?)

  3. #3
    Join Date
    Jan 2008
    Location
    Selm, Germany
    Posts
    116


    Did you find this post helpful? Yes | No

    Question Is Debug an alternative?

    in a post i read something like this:

    Define Debugin_Reg portc
    Define Debugin_Bit7
    Define Debugin_Mode 0
    Define Debugin_Baud 115200

    The baud rate seems to good to be true. is that possible with a 4 Mhz crystal , or maybe a 10 Mhz ? By the way I don´t get my Pic 16F628A-20 to work with max Speed regardless of capacitors. Tried several 20 Mhz crystals: No Go! tried several 10 Mhz crystals with different capacitors (27 pF-yes ,22pF-yes, 15pF-yes , 12 pF-no) and they worked.
    What could be wrong?

  4. #4
    Join Date
    Jan 2008
    Location
    Selm, Germany
    Posts
    116


    Did you find this post helpful? Yes | No

    Default portc?

    oh yes what does Portc mean in the upper post,
    why not Portc.0 or something?

  5. #5
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Mugelpower View Post
    in a post i read something like this:


    By the way I don´t get my Pic 16F628A-20 to work with max Speed regardless of capacitors. Tried several 20 Mhz crystals: No Go! tried several 10 Mhz crystals with different capacitors (27 pF-yes ,22pF-yes, 15pF-yes , 12 pF-no) and they worked.
    What could be wrong?
    Remember every piece of wire at radio frequencies exhibits the properties of inductance and capacitence, and the reactance of both. Which means the wire acts as both a coil and a capacitor.

    Might be you have too much wire attached to the Xtal lines, too many sharp bends in those wires, too low impeadance due to resistance path between pins somehow, If you forget to change the config fuse from XT to HS then insufficient power to OSC. Try using a resonator without additional caps and keep those wires as short and straight as possible.
    JS
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  6. #6
    Join Date
    Jan 2008
    Location
    Selm, Germany
    Posts
    116


    Did you find this post helpful? Yes | No

    Question Serial com with DEBUG

    Thanks for your Help so long Guys.

    As you know I will do as You tell and try. So I bought everything I need to try parallel com between pics but at first I will give "Debug" a try because its so fast (I read about that)

    Sending (with all the Defines at Baud rate 9600)

    CNT Var Byte
    ....
    ....
    Debug [cnt]


    Recieving (same Definitions)

    Debugin ; cnt

    .....
    LCDOUT $FE02 `something like that, worked before
    LCDOUT $FE80 "CNT=" , CNT
    ...

    I´m not absolute shure about the code BUT

    The LCD Display recieves something but only one Element which changes when changing the Input frequency
    It shows CNT=§ (its the german symbol for "Divide" I dont have it on my keyboard)
    or CNT=A (but only half symbol height and square)

    This shows the transmission works, its just like different languages.
    When I use Serout/Serin everything works fine
    then it shows "CNT=146" for example whith input freq 146Hz .

    There must be more about Debug/Debugin
    I tried changing the Var defines from byte to dec which changed the display from rubbish to rubbish .

    I thought if i´m sending a Var frompic to pic then it doesn´t change. Obvious it does.
    What I´mmissing?
    I´m showing the precise program code today in the evenig when I´m back home.
    I need just a simple example for sending a byte by debug from pic to pic.
    Oh yes I dream of baud rate 120000 or something....

  7. #7
    Join Date
    Jan 2008
    Location
    Selm, Germany
    Posts
    116


    Did you find this post helpful? Yes | No

    Default program:here we are

    This is for sending the variable "CNT"
    ' DEFINITIONS
    Include "modedefs.bas"
    CMCON=%00000111
    DEFINE OSC 4
    DEFINE DEBUG_REG PORTB
    DEFINE DEBUG_BIT 2
    DEFINE DEBUG_MODE 0 '1 = Inverted, 0 = true
    DEFINE DEBUG_BAUD 9600

    Cnt VAR Word ' Cnt is a word variable
    CMCON = 7 ' RA0-RA3 are digital I/O
    TRISA = 0 ' PORT A is output
    TRISB = %01111111 ' RB7 is Input others output
    cnt = 0
    main:

    COUNT PORTA.2,100,cnt ' Count for 1 second
    DEBUG cnt

    goto main


    END ' End of program

    And this is for recieving

    '
    ' DEFINITIONS
    Include "modedefs.bas"
    CMCON=%00000111
    DEFINE OSC 4
    DEFINE DEBUGIN_REG PORTB
    DEFINE DEBUGIN_BIT 1
    DEFINE DEBUGIN_MODE 0 '1 = Inverted, 0 = true
    DEFINE DEBUGIN_BAUD 9600

    Cnt VAR Word ' Cnt is a word variable
    CMCON = 7 ' RA0-RA3 are digital I/O
    TRISA = 0 ' PORT A is output
    TRISB = %11111101 ' RB1 is Input others output
    cnt = 0

    main:


    debugin [cnt]


    LCDOUT $FE,2
    LCDOUT "cnt=", cnt
    goto main



    goto main


    END ' End of program
    and it shows just rubbish as told in the post above.
    Any Hint?`

  8. #8
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Code:
    LCDOUT $FE , 2 , "cnt=" , DEC cnt
    Just like the good book says...
    That rubbish you say was the ASCII representation of the value in cnt.

Similar Threads

  1. Replies: 5
    Last Post: - 20th March 2006, 01:34
  2. Bootloader,MCSP and Serial communication
    By surfer0815 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 3rd March 2006, 10:52
  3. Serial Communication using 12F629
    By charudatt in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 14th March 2005, 04:24
  4. Serial communication PIC to PIC help.
    By Rubicon in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 24th January 2005, 15:45
  5. Replies: 8
    Last Post: - 11th November 2004, 20:08

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