cc3000 wifi module with ATMega168A

For Adafruit customers who seek help with microcontrollers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
Dan_83
 
Posts: 7
Joined: Sun Jul 06, 2014 3:53 pm

cc3000 wifi module with ATMega168A

Post by Dan_83 »

Hi All,

I'd like to use the ti CC3000 wifi module with my ATMega168A, how easy would it be to port the Adafruit Arduino version of the host driver? I figure it should be easy since it is the same family of microprocessors, but I don't know much about Arduino. I'm guessing I will need to copy+paste the relevant code, search for arduino library calls and replace them with custom methods for the specific microcontroller?

Cheers

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: cc3000 wifi module with ATMega168A

Post by adafruit_support_rick »

The 168 and the 328 are equivalent in terms of instruction set and hardware peripherals. There is no need to port the driver.

However, you probably won't be able to use the 168 at all. It has half as much memory as the 328, and only the most trivial of sketches will fit (and perhaps even those won't fit).

For instance, I just tried to compile the buildtest example sketch from the CC3000 library with a target board type of ATmega168, and the executable is 3K larger than the maximum possible sketch the 168 will hold.

Dan_83
 
Posts: 7
Joined: Sun Jul 06, 2014 3:53 pm

Re: cc3000 wifi module with ATMega168A

Post by Dan_83 »

I read that there is a "tiny" compile mode that only needs 6 or 7k flash memory, and my actual program code itself is only going to need a 2 or 3.

How did you compile the code for the 168, in atmel studio or an arduino ide?

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: cc3000 wifi module with ATMega168A

Post by adafruit_support_rick »

Arduino IDE. Just select 'Diecimila or Duemilanove w/ ATmega168' from the board types.

Dan_83
 
Posts: 7
Joined: Sun Jul 06, 2014 3:53 pm

Re: cc3000 wifi module with ATMega168A

Post by Dan_83 »

Thanks,

I've got the buildtest example to compile in 11K program memory by using the #define CC3000_TINY_DRIVER option, which will fit on my 168. Am I right in thinking that the Arduino IDE adds a load of bootloader code that wouldn't be necessary if I'm programming with an AVRisp MkII?

I'm still a bit stuck though: now I have this compiling in the arduino IDE, is it possible for me to somehow export this for use in atmel studio? I tried just importing the code (copy + paste to atmel studio) and it complained about all the arduino.h etc, so do I need to move across a post compiled version (I don't know arduino well, so I may be barking up the wrong tree here). Is there a tutorial to do this kind of thing?

User avatar
Franklin97355
 
Posts: 23910
Joined: Mon Apr 21, 2008 2:33 pm

Re: cc3000 wifi module with ATMega168A

Post by Franklin97355 »

The hex files created by the IDE are in c:\users\<user>\AppData\Local\Temp\ You may have to search under there for the exact location.

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: cc3000 wifi module with ATMega168A

Post by adafruit_support_rick »

You can download an Arduino extension for Atmel Studio 6. That should allow you to build the Arduino project.

You don't need the Arduino bootloader if you're using an AVRisp, although the Arduino project extension may not allow you to overwrite the bootloader area. I don't know - you'll have to check the documentation.

Dan_83
 
Posts: 7
Joined: Sun Jul 06, 2014 3:53 pm

Re: cc3000 wifi module with ATMega168A

Post by Dan_83 »

great, thanks. I'm just struggling trying to remove the bootloader from the arduino IDE at the moment but I'm gunna give this atmel studio extension a try

Locked
Please be positive and constructive with your questions and comments.

Return to “Microcontrollers”