Debug with parity?


Closed Thread
Results 1 to 5 of 5
  1. #1
    cmolson's Avatar
    cmolson Guest

    Default Debug with parity?

    Hello again! I have figured out the problem with the inverting of the bytes which I had before. It was one of those cases where the answer is starring you in the face but you are too tired to see it. Now I think I got myself into somthing too deep. Here is what I need to do:


    Send data serially at 9600bps with odd parity.
    Using a pic 16F84A
    Data must be sent on portb.7
    Oscillator is fixed at 3.579mhz

    Now using debug i am able to send data perfectly and recieve at 9600 baud using 3.579mhz. however the problem comes in when I have to use parity. Is there any way to set parity using debug? I looked throught the manual and found all the other DEFINE's for debug, but there isn't one for parity.

    Update:

    I have tried serout and serout2, both do not function proporly on my pic at 9600baud. Is there a way to speed them up by defining static port and baude?

    I'm thinking of maybe of an assembly routine to transmit the data.... I would just like some ideas to overcome this, not actual code.
    Last edited by cmolson; - 2nd December 2005 at 17:17.

  2. #2
    BertMan's Avatar
    BertMan Guest


    Did you find this post helpful? Yes | No

    Default

    Debug can only be used 8N1 (8 bits, no parity, 1 stop bit). To send data with parity, you need to use SEROUT2. You need to make sure you have your DEFINE OSC 3.58 statement. Unfortunatley, at speeds higher than 9600, you will need a faster crystal, and that is probably what is causing you problems.

  3. #3
    cmolson's Avatar
    cmolson Guest


    Did you find this post helpful? Yes | No

    Default

    Thats the problem I am facing. I do not have control of the Oscillator or the baud rate or parity. I tried serout2 and it is too slow to handle (also serout) at 9600bps and 3.579mhz. I have teseted the PIC at 10mhz and it can output 9600bps using serout without a hitch, unfortunatly the crystal is fixed at 3.479mhz.. grrr

    I have written the code for my applciation and it works perfectly when using no parity... I wish there was a way to send 1 bit out serially after each transmission of a byte with odd parity. I guess the question would be, does anyone think it wouldn't be too hard to create an assembly routine which sends a parity bit serially depending on the byte to be transmitted?
    Last edited by cmolson; - 2nd December 2005 at 18:06.

  4. #4
    cmolson's Avatar
    cmolson Guest


    Did you find this post helpful? Yes | No

    Default

    One method I saw which seems very basic, is to simply output the bits of each byte and use a pauseus 104 to generate 9600 bps. this way I could send the parity bit. For receivein i do the same thing except I can simply discard the parity bit. This is eally annoying since the parity bit isnt the last i can't simply discard it.

  5. #5
    Reven's Avatar
    Reven Guest


    Did you find this post helpful? Yes | No

    Question

    One small question. How can I use 2 stop bit?
    Now I use in my code 7E1 and I want to use 7E2.
    Thanks!!

Similar Threads

  1. N-Bit_MATH
    By Darrel Taylor in forum Code Examples
    Replies: 38
    Last Post: - 16th December 2010, 14:48
  2. About USB
    By dias11 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 3rd December 2009, 20:41
  3. Reading in Manchester code
    By brid0030 in forum Code Examples
    Replies: 0
    Last Post: - 10th March 2009, 21:55
  4. debug not working with MPASM assempler
    By santamaria in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 4th March 2009, 07:51
  5. Data EEPROM gets clobbered during programming
    By BrianT in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 18th July 2008, 02:46

Members who have read this thread : 1

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