Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Unable to get serial comms to work...

Status
Not open for further replies.

hawk1943

Member level 3
Joined
Jun 14, 2010
Messages
62
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
United Kingdom
Activity points
1,859
Hi there,

I'm struggling to get some bit bashing code for the PIC 16F684 up and working as it's been a while since I last wrote any C code.

The code was written initialy in 2003/4 and was used successfully in a number of different projects prior to me being made redundant and having to seek a new line of work...

However recently I have found need of the code so could do with a hand remembering how it works and whats now stopping it from working.

Basically, I'm a third year BSc Forensic Science student who's third year project requires the burial of porcine hind legs and the ambient and buried temperature to be recorded every 10 minutes and stored for a period of 10 weeks prior to being recoved and the data downloaded.

So the initial aim is to basically get the serial code up and running first allowing me a method to then test the hardware and software sections of the code as the project progresses...

However I am on a tight timeframe and have untill the end of July to get everything up and running...

I've attached the complete project including basic schematic of the PCB that I have built for test purposes, the PIC is being programmed in circuit...

But at the moment I am not seeing anything on the scope, the code just does not want to transmit any data and I just cannot see what I am doing wrong. I have gone through all of the projects that use the same method that are currently fully working and I just cannot see what I am doing wrong...

The only difference is that MPLAB and Hi-Tech are not the same version as previously used, everything else is identicle...

*** Just removed the attachment as the code was incorrect ***
 

I take it then that no one can help us out...

I just wish I could understand what I am doing wrong...
 

As i glanced at your code it seems that you did not turn off comparators.
You have to set CMCON0 = 0x00 in your main function since you are using RA1 and RA2 for transmission.

Hope that helps
 

That's an interesting thought...

I was under the impression it was turned off, i'll look into...

Thanks...
 

Hi
Sorry i was wrong you are right.
Your CMCON setting was correct.
I did not look at the datasheet...
 

I've just been looking at the Input Signal from the computer... as expected it's +/- 10V nothing unusual there...

Yet the signal on pin RA0 is only +1V / -.5V

I wonder if this is possibly what's causing me an issue?

Added after 3 minutes:

Guess what daft bugger left the ICSP connected to the PicKit 1 board???

No wonder I was having fun getting it to talk...

It's now outputting ">" on each new line...

Just need to tweak the baud rate now and she should be talking...

Added after 46 minutes:

Not sure what's going on here...

I've attached what I am seeing on the Scope and in Hyperterminal...

Can anyone help me translate it?

I beleive it should be: -
1 start bit
12 Data Bit's
1 Stop Bit
But i'm not sure...
 

Looking at the data being transmitted...

There seems to be 30 bits of data...

But there just seems too much data for a ">" so the other letter must be there...

I should be recieving ">A" when a "J" is pressed...
 

wrong baud rate setting, perhaps?
 

Hi John,

That's a very old post now... I did manage to solve the problem eventually not sure what the actual problem was but thanks for trying to help...
 

Ohh.. ok.. hahaaha

Helpful? Yes
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top