PDA

View Full Version : T300 & N300 Not working



Rubicon
- 5th February 2005, 13:12
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.

mister_e
- 5th February 2005, 16:36
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.

Rubicon
- 7th February 2005, 08:38
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.

mister_e
- 7th February 2005, 17:24
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.

Rubicon
- 9th February 2005, 11:11
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.

Archilochus
- 9th February 2005, 15:27
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

mister_e
- 9th February 2005, 16:42
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

Rubicon
- 10th February 2005, 09:57
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.

Dave
- 10th February 2005, 11:49
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

Rubicon
- 12th February 2005, 21:20
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.