Dcoklight Issue

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dears members,

 

I built a temperature controlled DC Fan circuit using atmega16 and the code is written using BASCOM.

the circuit is working pretty well on pruteus nad on real.

but i have an issue when i'm train to read serial data using dock light, i'm getting unreadable characters.

the communication parameters are identical

can you help me knowing the reason

 

u will find an attached photo describing the issue

 

Thanks

Ayman

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Need some more information.

 

How is the micro connected to the PC?

 

I suspect it is: Micro to RS-232 Chip to Serial Port on PC?

 

Next question:

What is the clock source for the micro?

The internal RC Oscillator, or an External Crystal?

 

I've not used an Mega16 in a long while.

Does it have a Divide by 8 Fuse, or something similar?

 

Have you written a simple "Blink an LED" at once / second program, (With Waitms), to confirm that the micro is actually running at the clock frequency you think it is running at?

 

In summary:

You need to verify you have the serial communications hardware set up correctly.

You need to verify that the micro is running at the correct speed.

 

If the micro is running on the internal clock source, instead of an external crystal, the frequency can be inaccurate.

If the clock is inaccurate, then the baud rate that is actually generated will be inaccurate, and the PC will not receive the data correctly.

 

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

IIRC the M16 has four internal RC osc's, 1,2,4,and 8MHz, but only the 1MHz calibration is loaded automatically upon startup, so have you found out what the calibration value is for 8MHz and are you setting the OSCAL value.  As already stated, serial comms need an accurate clock to work reliably. 

 

Jim

 

 

(Possum Lodge oath) Quando omni flunkus, moritati.

"I thought growing old would take longer"