CC2420 beginner (Atmega128)

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

Hi all, ~first time poster long time listener, and still a massive AVR noob.

I am trying to set up a network of CC2420 zigbee modules controlled by an atmega128 which will be acting as a sensor network. The hardware is prebuilt and supplied to me by my uni.

CSn -> PB0
SCLK -> PB1
SI -> PB2
SO -> PB3
VREGn ->PB5
RESETn -> PB6
FIFOP -> PD0
FIFO -> PD1
SFD -> PD4
CCA -> PD6

My problem is really a 'where to start' type problem. I personally learn best from studying existing codes, to see how each function or register is correctly used, and despite my extended google search abilities, and forum search abilities, I am unable to find anything helpful.

I've figure I should set the SPI registers (as well as ports to appropriate inputs/outputs)

SPCR = 0x53;
SPSR = 0x00;

and then I send data;

SPDR = dataSend

If someone could please point me in the right direction, I would like to start by making a simple point to point network that lets me switch on/off LEDs on one device, using the push buttons on another. I am moderately competent in led switching/interupts/timers etc already (thanks to this website), its the transmission side of things that is letting me down. I believe it has alot to do with misunderstanding how the CC2420 utilizes the SPI interaface.

Any help would be appreciated. I feel a simple push in the right direction could really get the ball rolling.

attached is a board shematic for anyone interested

Attachment(s): 

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

Quote:
My problem is really a 'where to start' type problem.
Surely your uni teacher would be the best person to ask to start off with. :)

edit and by the way it's the 2nd post from you https://www.avrfreaks.net/index.p...

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

I have tried the uni technical staff, and the tech that built the boards, and would know, is on 6 months long service leave. Just my luck.

Additionally this course is a self directed major project, I dont have a uni lecturer per se, I have a supervisor, who is very knowladgable, just not in the area of micro controllers.

If worse comes to worse I'll do it the old fashion brute force way of trial and error. LED debug style.

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

jagbags wrote:

My problem is really a 'where to start' type problem. I personally learn best from studying existing codes, to see how each function or register is correctly used, and despite my extended google search abilities, and forum search abilities, I am unable to find anything helpful.

I would start with the datasheet of your controller and transceiver. The former has all the info you need to bring up SPI communication and the latter has all the required info such as the SPI message protocols and how to read/write the transceiver registers. Try to read a register with a known value or write and read-back a register to make sure SPI is working. Then set the parameters such as short address, extended address etc. on the transceiver and try to send out a single packet. Check with a sniffer that the packet is actually getting transmitted. That would be a good start :)