T300 & N300 Not working


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Rubicon's Avatar
    Rubicon Guest

    Default T300 & N300 Not working

    Hello,

    In Pic to PIC serial communication I cannot get the T300 or N300 baud rates to work. Using the basic (nothing fancy) SEROUT/SERIN statements it works fine on T1200, T2400 or N1200, N2400 and I can't understand why it won't work at 300 bps.

    I have no scope but a LED put on the SEROUT pin flickers making me think it's a SERIN problem.

    Any suggestions as to why is so are welcome as it's got me stumped.

    Regards,

    Andrew.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    mmm, can you do one test with a PC???

    What is the result if you send to PC ???

    what is the result when you receive fom PC ?

    Can you test a 1200 bauds and decrease you crystal speed by 4. I.E. Use a code @ 16MHZ for a 1200 bauds who works and change the crystal to 4MHZ without changing the DEFINE OSC 16... but changing the HS setting to XT.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Rubicon's Avatar
    Rubicon Guest


    Did you find this post helpful? Yes | No

    Default

    Steve,

    Thankyou for replying to one of my posts again.

    I have never tried connecting a PIC to a PC though I'm looking into it.

    The other option you suggested with the DEFINE didn't work.

    Perhaps it may be a bug with the old 2.04 version I have. I looked at the modedefs.bas file and it does contain both N and T300.

    I've been hammering away at this for over a week now to no avail.

    One thing I found which I was mistaken about was that my PBP version goes only to 16F84 and not the 16F84A PICs I'm using.
    Strange that I seem to be able to compile and run the programs most of the time without a problem. This could well be the root of the N&T300 problem I suppose.

    What do you think of using T1200 with CHAR_PACING 3000 to slow it down to (I think) approx 33 BPS? I need a slow BPS as I'm trying to transmit a single byte of serial data ultrasonically, 24kHz to start with then perhaps 40kHz. At the moment I have SEROUT from the TX 16F84A going to a 555 timer at 24kHz then on to a 4069 buffer for maximium 9V V+ to the transducer. It's not working or should I say I only got it going once or twice and then only short range and sporadically. T1200 was too fast hence the need for T300 and the 555 wasn't passing on the PICs SEROUT very well either. Connected directly via a wire TX PIC to RX PIC was good but TX PIC to 555 to RX PIC was poor. A very low byte "match" rate. I think it's the 555 55% duty cycle.

    I read that a TMR interrupt can be used to toggle an output pin at 24/40kHz connected to the input of an AND gate while another output pin is connected to the remaining AND gate input to toggle the carrier on and off to send data. The AND gates can be used to switch transistors for a higher than 5V supply to the transducer. This sounds good but is beyond me and I thought that PICs where incapable of multitaking? Isn't this multitasking?

    Regards,

    Andrew.

  4. #4
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    can you post your schematic and the whole code ??? will be handy to figure out how to solve your problem then.

    Are you saying that it doesn't work if you change your crystal from 4 times lower speed??? it suppose too BUT you must recalculate all the interrupt, cycles and delay considering this new clock speed. It's only for your Baud rate. Any delay, must be divide by 4. It has to work.

    I'll suggest to upgrade to new version 2.45. Worth the investement i tell you.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  5. #5
    Rubicon's Avatar
    Rubicon Guest


    Did you find this post helpful? Yes | No

    Default

    Steve

    If I have the RX PIC set to T1200 and Defined to 16 MHz but running on a 4Mhz crystal with delays altered while the TX PIC is set to T300 and N300 on a 4MHz crystal, it doesn't work. I've tried all kinds of combinations and it just won't work.

    Went out and tracked down some 16F84 PICS and have just tried those and they too won't work on T300 or N300.

    I really think it's the PBP version now that the 16F84 PICs won't work either.

    I can post a rough schematic and the whole code if you can wait a day or so and still wish to look into this?

    Yes the latest version would be nice.

  6. #6
    Join Date
    May 2004
    Location
    New England
    Posts
    164


    Did you find this post helpful? Yes | No

    Default

    Hi Andrew,
    I've got the PBP 2.4x manual, so I don't know if this applies at all to 2.04 or not...

    Have you tried using the PBP "mode numbers", rather than the Stamp "mode names"?

    Stamp > PBP
    T300 = 3
    N300 = 7

    Arch

  7. #7
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Originally posted by Rubicon
    Steve

    I can post a rough schematic and the whole code if you can wait a day or so and still wish to look into this?

    Yes the latest version would be nice.
    attach a zip file with schematic and code to you post, I or WE look at that for you... sure
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  8. #8
    Rubicon's Avatar
    Rubicon Guest


    Did you find this post helpful? Yes | No

    Default

    Steve and Arch

    Thanks.

    I'd tried the mode numbers before on the 16F84A PICs without success but not on the 16F84. Once again the mode numbers worked on T1200 but not for T300 even on the 16F84.

    Cobbling together a schematic.

    Regards,

    Andrew.

  9. #9
    Join Date
    Mar 2003
    Location
    Commerce Michigan USA
    Posts
    1,166


    Did you find this post helpful? Yes | No

    Default

    Rubicon, Have you tried using the SERIN2 command instead of the SERIN? I have used the SERIN2/SEROUT2 commands in the past with 16F84's with no problem. For 300 baud true logic the mode number would be 3313 and for 300 baud inverted logic the mode number would be 19697. I also beleive the SERIN2/SEROUT2 commands give you more options as far as data handling.

    HTH,
    Dave Purola,N8NTA

  10. #10
    Rubicon's Avatar
    Rubicon Guest


    Did you find this post helpful? Yes | No

    Default

    Steve,

    Sorry it took so long. I think the code and schematic are correct.


    Dave Purola

    Unfortunately the 2.04 version doesn't have SERIN2/SEROUT2 but thanks anyway.

    Regards,

    Andrew.
    Attached Files Attached Files

Similar Threads

  1. 16F877A with 20MHz XTAL not working?
    By ustredna in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 19th August 2011, 15:04
  2. 2x16 lcd not working with pic16f72
    By vu2iia in forum Schematics
    Replies: 4
    Last Post: - 16th February 2011, 14:59
  3. Blink.Bas on 18f45k20 Newbie seeks working example.
    By DiscoEd in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 29th December 2009, 03:36
  4. Pic 16 F628A not working
    By turkuaz in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 17th March 2009, 12:26
  5. Hserin not working...
    By robert0 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 22nd August 2005, 12:25

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