[LW Mesh] Frequency problem

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

Hi !

I'm using ATZB-A24-UFLR module with LW Mesh.

My main looks like this:

int main(void)
{
	SYS_Init();
	HAL_UartInit(38400);

	while (1)
	{
		SYS_TaskHandler();
		  
	 	HAL_UartTaskHandler(); 
		  
		APP_TaskHandler();
	}
}

My UART works OK with 4800bps with HyperTerminal but not with 38400 as defined in main().

And also my timers are 8 times "faster". I blik LED with timer of 125 ms to get blinks of 1 second.

Looks like my frequncy is devided or multiplied by 8. ATZB-A24-UFLR module has frequency of 8 MHz I think.

I also run BitCloud on this module and everything's OK. (UART and timers)

What do I have to change in app?

Thaks and regards !

Last Edited: Fri. Oct 16, 2015 - 02:12 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi xtal_88,

It seems that you haven't a correct fuse settings. If my memory doesn't fail me, fuse settings are different for BitCloud and Lightweight Mesh.

Regards,

Rober

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

You need to disable CKDIV8 fuse.

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.

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

Thank you for quick responses guys!

I remember that I had some problems with fuse bytes/bits.
I disabled JTAGEN or some other bit(s) on few modules and couldn't flash them any more.

If I understand what you are saying :

if I use BitCloud, CKDIV8 must be enabled ?

and

if I use LW Mesh, CKDIV8 must be disabled ?

Once I disable CKDIV8, can I set it again without any problems ?

Thank you once more !

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

Yes, you can. Furthermore, you can disable it in the software:

CLKPR = (1 << CLKPCE);
CLKPR = 0; 

NOTE: I no longer actively read this forum. Please ask your question on www.eevblog.com/forum if you want my answer.