Raven and GPIO pins

Go To Last Post
78 posts / 0 new

Pages

Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi All

I am trying to access PORT A pins, for some reason when i use the following pins, my connection to the network fails.
[url]DDRA |=(1 <<1);//high--postive polarity
DDRA |=(1 <<2);//high--negativ polarity
DDRA |=(1 <<3);//high--enable DC-DC[/url]

Once i comment this out it connects.

PORT A the ADC, but i want to use it as a normal GPIO.

Is there a limitation on which GPIO is can use and can not.

Regards

DJ

Thanks

Regards

DJ

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

Don't keep us in suspense--what are those pins connected to on the "Raven" board? Which processor are you programming?

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

It connected to nothing at moment, they are just the adc pins.
I am using Atmega 1284P with the bit cloud stack.

Thanks

Regards

DJ

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

djoshi wrote:
It connected to nothing at moment, they are just the adc pins.
I am using Atmega 1284P with the bit cloud stack.

Where do you put these lines? BitCloud itself does nothing with these lines.

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

Thanks , i have managed to get it working.

PORTA pin 0 is a input, of a switch. So on the first ever boot after programming,a user must press it.

PIN's 1,2,3 are output.

Pin 2 and pin 0 were shorted, it was a very small amount of solder, but i removed and thing look much better .

But i need to test it first.

Thanks

Dj

Thanks

Regards

DJ

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

If I'm not mistaken, having read the Bitcloud documentation, I thought you were not supposed to drive any pins directly but had to use the Bitcould "wrapper" to ensure you didn't screw up the stack....

What I couldn't make any sense of is exactly what "resources" are required by Bitcloud for each processor and what "resources" were left on each processor for you to use in you application. - As in all resources, I/O pins, Timers, Flash, RAM, stack depth, etc.

For Goodness sakes, can someone from Atmel (or one of the thousands who got free Ravens) please awnser some really simple questions regarding Ravens and Bitcloud for those of us who don't have them and don't use GCC.

1) How much FLASH and RAM is free in each processor for our code?

2) What I/O and resources are free in each processor?
2a) How in the heck to we actually use these "free" resources"?

3) What hoops do we need to jump through to use these "free" resources?

4) Why hasn't this been documented in a single and easy to ready document as per these documents:

http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en520606
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en542094
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en537767
[

For what it is worth, I have spent between 36-48 hours of solid resarch on Atmel Zigbee solutions and have not been able to answer the questions above. I have spoken to people you gave FREE Ravens to and they have not been able to answer the questions above. I have read every single message on AVRfreaks.net related to Ravens, Micronetics, Zigbee, and anything else related to same and have not been able to answer the questions above.

I have spoken to local Atmel Distributors and since I only buy about US$50,000- of Atmel processors a year, was told I can either a) Buy some Ravens or b) get a "loan" to play with them for 2 weeks (if I return them in saleable condition)

I've downloaded everything, and still can't get basic questions answered. I spent 30 minutes at http://www.microchip.com and learnt more about Zigbee and 802.15.4 in that time than did after wasting a week with the info from Atmel.

I know I am not alone. In almost every Raven/Zigbee thread, I see Stalwarts such as "Smiley", begging for answers similar to mine, so what gives?

Do you guys really want to sell this stuff or are you just paying lip-service to your client base in a hope that they don't start looking for alternatives?

Oh, don't even get me started on things like Xmegas or heaven forbid things like AVR32. Who on earth was the rocket scientist who let them make the AVR32 big endian?

Don't you guys know the basics of regression testing and code re-use?

'sokay, I'll take two little Red Pills followed by two little Blue Pills in the morning and all will be well, but be aware that I am (seriously) looking at alternatives who may appreciate my US$50k+ each year.

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

Yes and no in regards to the GPIO card pins. The stack use functions which are not ready to output and input pins. I say they are not ready as that is what is said in bitcloud user guide.

Have you read the bitcloud guide, it has all your answers, becuase the RAM and flash will depend on your configuration.

Regards

DJ

Thanks

Regards

DJ

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

I must admit I have to agree with Brenton. Atmel are not doing themselves any favours by ignoring what seems to be the general sentiment that ALL the raven code they have made available is much too hard to integrate into an application. After approximately 30 hours of trawling through the forum posts, tutorials (I use this term loosely) and example code I have been forced to throw away the cost of the raven, and my time, because I can see that developing an application based on this platform is just going to take too long. Instead, I am using RFM radio modules to handle my wireless communication. If anybody from Atmel happens to read this then I would suggest you take notice. I seriously doubt I am the only one who has moved away from your product in order to reduce their development time…

Alex Kendon

New Zealand

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

And the docs need re-updating.

The largest known prime number: 282589933-1

In my humble opinion, I'm always right. 

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

Brenton_S15 wrote:
If I'm not mistaken, blablabla...

http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en520606
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en542094
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en537767
[

....blablabla be aware that I am (seriously) looking at alternatives who may appreciate my US$50k+ each year.

Wow! The most important part of all this stuff - links. How much do you have from Microchip per a year...? :-)

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

Quote:
Who on earth was the rocket scientist who let them make the AVR32 big endian?
Sitting Bull?? ...or some other kind of bull... :lol:

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

well guys i have manged to get RAVEN working for my application, which controlling switche and reading sensor via the ADC.

What are you using the RAVEN for?

DJ

Thanks

Regards

DJ

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

I'm trying to use it to learn to use the modules. Since I'm a garden railroader and my trains are all R/C, I figured I'd start with a train controller with one Raven in hand and one in the train (not the bush).

You can see what I've learned so far at

http://www.outsidetrains.com/raven/raven.html

(I exported this from MS word and don't know why it had to "Correct" image 5 and crop it horribly.)

The largest known prime number: 282589933-1

In my humble opinion, I'm always right. 

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

Torby

Well the Raven works and it getting simpler as thinking more about it and work on it,

From what i have seen in the attachment you are mixing two differnt stack ups.

In order to use bitcloud, you will need a JTAG programmer to program the usb stick.

Unless you want to solder lead to EEPROM, in order to get the ISP connections.

There is bitcloud 1.5.1 stack on there website, if you download that first and extract it.

There you will see a program called WSN.

First get that running.

Once that is running, post me reply on here or PM me.

I will take you step by step and getting you working.

Atmel havent done a good job decribing thing well, i do agree.

But its the bitcloud Zigbee PRO you want to use, i can help you on that. But i havent used the default stack, which is not Zigbee, that you are currently struggling with.

DJ

Thanks

Regards

DJ

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

Hmm. Not the BitCloud SDK for ATAVRRZRAVEN (23 MB, revision 1.6.0, updated 8/09)?

The largest known prime number: 282589933-1

In my humble opinion, I'm always right. 

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

Seem it an update, so i will check it out.

Thanks

Regards

DJ

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

Thanks, DJ, I've been looking for a bitcloud guru to help me sort this out.

Alas, I'm having less and less time to spend on this. The boss wonders why I don't do 80 hour weeks. I'm getting too old for that :roll:

The largest known prime number: 282589933-1

In my humble opinion, I'm always right. 

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

No problem

We go by step by step.

First we will run them demo, then we do a custom application. EVEN with out the USBstick.

I downloaded it yesterday, so i am playing around with that as well. Same as 1.5 really.

1.

I suggested downloading it.

2.

THE usb stick, solder wire on the EEPROM legs. This way we get ISP connection.

Then using the ISP program see that you can read the ID.

Once this is down, reply back on this and i will go through the next few steps.

Regards

DJ

Thanks

Regards

DJ

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

Quote:

I've been looking for a bitcloud guru

Looks like someone else just joined that club:

https://www.avrfreaks.net/index.p...

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

I can read these eeproms with my ISP programmer?

The largest known prime number: 282589933-1

In my humble opinion, I'm always right. 

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

You are not reading the EEPROM, you need to read the AVR

90USB1287.

As we dont have ISP headers on this USB stick you need to do that.

Then click on the folder Third party software, and install that driver. Maybe you need to unistalll the previous USB driver. But you need to install the drive in the folder.

Once you done that, you install WSN monitor.

The idea at this stage is to see the Cordinator, if driver are installed correctly, you will see the cord in WSN monitor.

Regards

DJ
DJ

Thanks

Regards

DJ

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

Once that is done, we will work on the end node

Thanks

Regards

DJ

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

Oh. I get it. You just have to use language I understand:

"Glob an ISP connector for the AVRglobber on the USB thingy."

Whew tiny. This is for the M1284P, right?

I'll need my "microfier."

The largest known prime number: 282589933-1

In my humble opinion, I'm always right. 

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

Whew! Got an ISP connector onto my USB stick. Had a short, but now the stick works. Next to try ISPing it.

Where's my crosseyed smiley?:roll:

And it works! I've read the signature, and the eeprom contents. Now, where were me?

Signature: 1E 97 82
EEProm seems to be unused, all FFs.

I think I'll go to the garden for mental health reasons.

USB Driver: My 3rd party folder from v1.6.0 has only an INF file. My installed AVR USB driver says it's Version 1.00.0001

The largest known prime number: 282589933-1

In my humble opinion, I'm always right. 

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

djoshi wrote:
Have you read the bitcloud guide, it has all your answers, becuase the RAM and flash will depend on your configuration.

Hi DJ,

es, I have read the Bitcloud documentation and every other scrap of info I could find related to Bitcloud, Ravens, Meshnetics Modules, and Zigbee in general.

Specifically with Bitcloud I have read:

doc8199.pdf = Atmel AVR2050: Bitcloud User Guide - Revision_D 05/09
doc8200.pdf = Atmel AVR2052: Bitcloud Quick Start Guide - Revision_E 09/09

I have also downloaded all of the SDKs and tried to learn what I can from them without compling them as I don't have the GCC compiler loaded and needing to do that seems just a little over the top. I have read the various help files and notes that accompany the source packages.

AVR2050 Contains some very salient points that you must adhere to if you intend to use Bitcloud and these are detailed in Section 3 - User Applications Programming.

3.2 All applications based on the BitCloud SDK are written in an event-driven or event-based programming style.

3.3 A major aspect of application development is managing the control flow and ensuring that different parts of the application do not interfere with each other's execution.

6 - Hardware Control: In addition to the ZigBee networking functionality described in Section 5, the BitCloud API also provides an extensive support of common HW interfaces such as USART, TWI, SPI, ADC, GPIO, IRQ, etc., Hardware Abstraction Layer (HAL) component of BitCloud is responsible for all interactions between Atmel modules and external periphery.

I'm okay with all of the above and it is to be expected, as the primary task of Bitcloud is to manage the radio link and ensure good reliable communications between the devices.

As best as I can make out, In the ATmega1284P, Bitcloud requires around 6k of RAM, which leaves you with 10k. It will also require 116k of Flash which leaves you with 8k. It requires all of the 16-bit counter/timers, leaving you with one 8-bit timer. From what I can determine so far, while consuming all of these resources, it still can't act as a Network Co-Ordinator, which means you need some other device (expected to be a PC) acting as the Network Master before you can get two devices talking to each other.

These numbers (which I derived from Atmels documentation) can't possibly be right, can they?

By way of comparison, Microchip have two code bases for Zigbee type stuff. One is called MiWi which is a trimmed down Zigbee where they manage to do the same thing and only require 12k of Flash and less than 512 bytes of RAM while providing network co-ordinator facilities. If you just want to point 2 devices at each other in a P2P configuration, it only needs 6.5k of Flash (which can be trimmed down to under 4k) and about 256 bytes of RAM. A fully certified Zigbee-2006 stack is less than 96k and yes, both options (MiWi or Zigbee) can act as a Network Co-Ordinator (so you don't need a PC). On the hardware side, it requires an SPI port, 3 I/O lines, 1 interrupt line, and 1 timer.

Alexander_L wrote:
How much do you have from Microchip per a year...?

Before all the Zealots start climbing on me for Atmel bashing or promoting a competitor, I am not promoting anything. I am comparing two devices based on the information available. For the record, I haven't used a Microchip device since 1989 and would prefer to keep forging ahead with my investment in Atmel technology. I'm not about to throw that away and would dearly love to use an Atmel solution here, but I can't get any info and what I can find doesn't look that good.

Oh, just for good measure, pretty much everything in the documentation and help files, keeps telling me that most of the Harware Abstraction Layer stuff isn't implemented, which seems to make the whole stack useless. Being an RF based protocol stack with very tight timing requirements, I can only imagine that attempting to access the hardware directly as you are doing (or in the manner I will be doing it) is a nightmare just waiting to happen (at least for me and my application).

I sure hope Atmel didn't pay much for Meshnetics, because it doesn't look like they got very much for their money.

From what I have seen here on AVRfreaks, it seems that most of you just want a link between two devices or a simple yet secure Peer-To-Peer network of devices. RF PC Connectivity would be nice and great if it was available, but is not mandatory. If you were to discover that a simple point-to-point link between two devices only used 4k of Flash and 256bytes of RAM, while an entire network used about 12k Flash and 512 bytes of RAM with a per station cost for a fully assembled module was under US$10- in quantity 1, you'd be quacking like ducks - if it were from Atmel.

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

Dear Brenton

The sizing are more a less right, but depends on your configuration.

Quote:

I have also downloaded all of the SDKs and tried to learn what I can from them without compiling them as I don't have the GCC compiler loaded and needing to do that seems just a little over the top. I have read the various help files and notes that accompany the source packages.

Are you using the IAR, the new 1.6 has support. I would advise you to try it out.

Quote:

3.2 All applications based on the BitCloud SDK are written in an event-driven or event-based programming style.

Can this be an issue, if so why and how

Quote:
It still can't act as a Network Co-Ordinator, which means you need some other device (expected to be a PC) acting as the Network Master before you can get two devices talking to each other.

Why does it not act like CORD, please describe as I have managed to get simple mesh network up and running. I say simple because i have only limited RAVENS.

I am planning to use another AVR as well, that will do all my back processing, so the ATMEGA1284, only sends and receives messages, i will commentate with two AVRs using TWI or SPI.

Regards

DJ

Thanks

Regards

DJ

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

Torby,

You can read the ID.

If i am correct it is a ATMEGA USB1287. Please check.

What you need to do is uninstall you current driver and then remove the STICK insert it and wait for windows to ask for driver and take them to this INF.

This is very important.....

In the meantime you can download java runtime enviroment, so the WSN demo monitor can run.

Let me know how it goes.

Thanks

Regards

DJ

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

Hi DJ,

My compiler of choice is not IAR or GCC. I don't want to buy into the "Compiler Wars", so lets just say that it is one of the main-stream AVR compilers that many others agree is the best value for money although this may have become a little stretched with a major upgrade recently which kills backwards source compatibility raising all sorts of other issues.

Regarding the Event Driven architecture: It seems that Bitcloud needs to assume that it has total control of the CPU and all timing. This is not uncommon and is to be expected given the nature of what Bitcloud is doing and it's prime task of ensuring that the RF link and data being moved across the link is the most important thing in its life. Therefore, the "application" or "your code" is actually a secondary function as far as Bitcloud is concerned, and rightly so.

In an "Event Driven" architecture, the "Events" or priority of processor resources, are often tilted towards the most important task or "Event" that the processor needs to complete properly. I'm trying to find a way to explain in less than 1,000 words why the RF link is a more important "event" than your "event" of toggling an I/O line or reading an ADC port - If I don't manage to do this, I would like apologise up front, here and now.

Think of it along the lines that every single thing the processor does is an Event. Each Event (or part of an Event), needs to be carefully controlled from a timing perspective to ensure that the right things happen at the right time. While some events can occur at random or slightly delayed times, others can't, and as the core "stack" or protocol defines what Events need to occur when, the main task needs to control this timing and not your code.

This means that if you try to write directly to a UART or SPI transmit buffer, or instructed a read from an ADC input and the main control program does not know that you've done this, you could inadvertently throw out the timing of the main control loop/code which can screw up the core function of the code - in this instance moving data across an RF link in an error-free manner.

Remember that while it might only take 1 micro-second for this to happen, the culmination of lots of little 1 microsecond "stalls" that the main control program doesn't know about and after a while you are out by 1ms (100 x 1 micro-second delays) before things start to get screwy, and by now you've got no chance of working out why it doesn't work.

So the main control loop can keep track of exactly what is going on with timing and every IO line, you really shouldn't write to an IO port directly.

Instead you should write to the main control loop (not necessarily main() (or a part of it) and tell it that you want it to toggle a line or move some data. But, you want to know when it has done this.

To do this, you use what are known as "call-backs" and Bitcloud relies on this method.

Basically, instead of toggling an IO line yourself, you tell Bitcloud to toggle the IO line as soon as it can and when it has done that, you ask it to report back to you. Of course, it can only report back to you by jumping to a specific address you have given it (the call-back address) so that when the bit has been toggled, Bitcloud then runs your code again from/at the address you told it to. Hence the term, “call-back’.

In short, you pass control to Bitcloud with an instruction and data. You tell Bitcloud that when it has done this task, it should then pass control back to your code and tell it the address to jump to, to do this.

Windoze is the best and worst example of this and Serial Communications (async or sync) are the things that send most programmers insane because you can't do them without call-backs if you really want to understand what is happening.

Example: Assume you need to send a packet of 128 bytes out of the serial port at 19,200 Baud. 1 / 19200 = about 52 microseconds per bit. For each bit we need a start-bit, a stop-bit assuming no parity. Therefore, we are talking about 10 bit periods per byte or about 520 microseconds per byte, which means that to transmit 128 bytes, it will take about 66 milli-seconds which is an eternity to a decent or half-fast processor. … Whoah, Hang-on a second... Bitcloud (or more specifically, Zigbee) has a minimum response time to everything of about 10 milliseconds, which means that our 128 byte packet is now takes 6 times longer than the minimum response time between the two radio transmitters. Holy crap, we’ve got a problem Houston.

So to send our 128 byte packet, Bitcloud must be in control of all the timing. Therefore, what we do is pass the start address of the data packet to Bitcloud, along with the length and anything else required by the Bitcloud API and just ask it to deliver it to the other end and let us know when it has finished. We tell Bitcloud to "call" or "run / pass control" to our code at xxxx:xxxx when it has done this, which it will do. In the meantime, Bitcloud may have total control of every CPU/Processor/Machine resource or it may pass control back to another thread or part of our program while it "trickles" the data out of the serial port.

I hope this makes sense. If not, just yell, and I'll try to write it before I've had 6 beers :)

Where this gets even harder to get your head around is that Bitcloud itself knows that it will be wasting a lot of time waiting for things to happen. Therefore, it won't want to chew up every available processor cycle waiting for an IRQ or some other thing to happen. In other words, Bitcloud will be trying to pass control back to our "application code" as soon as possible, so that we can be doing other things and not wasting valuable time, yet it can't really pass control back to our Serial Transmission stuff until it has sent all 128 bytes which takes at least 66 milli-seconds assuming it doesn't need to retransmit anything.

Therefore, we need to write our code so that we can start a serial transmission and continue on with other stuff (not related or perhaps we do just wait) until the packet has been sent. If we get our architecture right, it doesn't matter how long it takes to send the data packet because we have been doing other stuff.

The real trick here is how to handle over-runs or "race conditions", whereby something that relies on the successful transmission of the data is the next thing to do, but we don't know if the packet has been successfully sent yet, or even if it has been sent at all. It's sorta like the ultimate "interrupt driven" program although you're not in control of all the interrupts and when they "fire".

Another way to think of “Event Driven “ code is to think of your main loop as being nothing more than being an empty while(1) loop, with the entire program being totally interrupt driven and having all of the flags and semaphores in place to ensure that one interrupt handler didn’t crash another and that everything just “happens” correctly. If you write your code in this fashion, you won’t have an issue with Event Driven programming, you may just need to shift your viewpoint, and if you can handle Event Driven programming you can create a program which just consists of a main(while1))) loop. Reality will often mean you will have a few things going on in your main_loop, but as you start to become more “event” or “interrupt” driven, your main() processes often become smaller.

Anyway, I’ve probably used more than my allocated 1,000 words and six beers, I hope this makes sense or at least helps. I know you young guys want everything in 2 lines or less (and before the first beer) and prefer the final working code to be posted, some things just need to be learnt. If I’ve screwed you up, let me know where you’ve lost it and well try from there, (after I’ve blamed the Heineken) but I hope this goes someway towards helping your understanding.

Regarding the Network Coordinator – Can you answer one simple question that I can’t find in the documentation…. Can you get your two Ravens to talk to each other using Bitcloud without having a USB stick in the PC?

If you can, then one of the Ravens must be acting as the PAN (Network coordinator – basically the manager). If you can’t, then the whole Bitcloud stack is a heap of crap as it can’t perform the most basic and important function of the network, which is managing the various nodes and keeping track of who is who and what is what, without this function being performed by a PC. This makes Ravens and Bitcloud (which means the entire Atmel model) totally useless for those of us who need a basic and simple RF link between two nodes, because it means we need a US$1,000 PC in the middle of our stuff no matter what.

To clarify things a little in what I am looking for from Bitcloud. It seems to me that the AVR1284 which is controlling the RF Link has some spare (free) resources. While we need to do some tricky and complex stuff, I would have thought that we could spin this stuff out into another thread within the ATmega1284, using either an Event or Interrupt Driven model. Some of this is pretty intensive from a time point of view, but if it took a second, we could live with that, and give most of the processing time and CPU resources to Bitcloud if it gave us time (and memory / IO) to do what needs to be done, and pass our user interface off to the other processor to handle some simple keystrokes and driving of the LCD. In short, we could use the Raven Model at both ends to accelerate our development cycle. From what I can work out from the docs, we can’t do this because the basic Raven model won’t allow it. Worse yet is that I can’t determine if I can push what I want/need into the ATmega1284 as the workhorse, and what I can and can’t do with the second CPU is totally unknown. I hate to say this, but I think I can do the whole enchilada with a PIC18 or PIC24 in a single processor. Mind you, I’m not silly enough to believe what I read is spec sheets, but I have been trolling the forums (and ignoring Leon’s posts in both (joking Leon :lol: )) and I’m pretty sure I can do both functions in the one processor with a MC/PIC solution for under US$15-.

From Atmels viewpoint, this spells the thin edge of the wedge. After more than 20 years, I now have an application which draws me back to Microchip, and worst yet is that I have been looking at the 16-bit PIC and more recently their implementation of the MIPS architecture in the form of PIC32 as my future platform to succeed the AVR8 bit. It took 20 years for Microchip to get me back, but I think they may have done it :lol:

FWIW, clarification may be required. While many of the forum users here now may know of Microchip by their current name, I knew of them under their former name of General Instruments. In their day, like AMD, GI were responsible for bringing to market some of the wildest silicon ever conceived. They are single handledly responsible for the development of UARTS, Sound Processors and Single Chip Video Processors with their AY-xxx-xxxx line of stuff back in the mid-late 70’s. The PIC family was originally intended to be a universal IO Controller, which is where the name came from (Peripheral Interrupt Controller = PIC) and was evolutionary for its day.

Sure, it’s got some warts, but you need to remember this was an idea which was spawned before most of you guys. Although like some of you, beer was probably involved. Yeah, I’m an Australian and what can I say, but JS is not typical, it’s just that he doesn’t drink beer and can type after 9am :lol:

Side Note/Question: does anyone remember the Harris X300 (or was it the x600) slice? This was before the AMD-2901/2904 and was sex on/in silicon.

Anyway, I digress. I hope this helps clarify things a little, if not let me know where I’ve screwed up and lost you.

Cheers, Brenton

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

Well Brenton

I will reply back to you properly once i am on my pc, at moment i am using my berry. So i ave just read things fast.

Your question about making a RAVEN a cord instead of a the USB stick, the answer to your question is YES.

I have done it my self, and i also emailed Atmel and they confirmed.

See the RAVEN uses Bitcloud to implment the WSN demo, Using one RAVEN to another will take the PC and WSN interface out, but still keep the embeded WSN . Matter of fact i was going to show Torby this exactly.

Atmel have not mentioned this as this will just confussion the whole WSN demo app.

Once i get hope i will read your post properly and reply fully.

By the way which part of the World are you from, i am from the UK

DJ

Thanks

Regards

DJ

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

Yes. Using my magnifier I can see it's a USB1287. They need to use brighter print ;)

Something seems to have gone awry with the install/uninstall... Let me try again. Windows bonks seeing that I've put in the usb gadget, but doesn't ask about it... Tried the new hardware wizard, but it complained... Of course, my ravens no longer find the network.

Rebooting.

It gives me:

Eek! The little cap that was blocking pin 20 is missing. I found the reset line on the JTAG connector. Let's see... (I should be working on golf software) It's C24, part of the reset circuit. 100nF

The largest known prime number: 282589933-1

In my humble opinion, I'm always right. 

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

Hi DJ,

I am a from "The South", the deep South. This means I can cope with all the Samperi's you can throw at me as well as the occasional Valuesoft, and I want to hire the first abcminiuser who completes his education so I can really teach im a thing or two, three if I'm really lucky.

In simple American; I am an Austrlaian, just like the other rat-bags on this forum. :)

Your message is encouraging yet depressing, although I look forward to your detailed reply once you get off of "the Berry", which has goot'ta suck. :( I know what that is like though as I've been fighting with my ISP for 12 days now as my connection is going down more often than a $20 whore.

On a positive note, if it's not obvious to the rest of the world, I'm guzzling more beer to compensate :) which will no doubt make all the other Aussies proud :lol:

Although some of my best compositions are ending up in the trash bin because my link is dying when I click on the "Submit" button". Then again, perhaps God is trying to tell me sumfin :)

Cheers, Brenton

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

Quote:

I am an Austrlaian

Oh I love the mountains and Eidlweiss there!

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

The mountains and Eidlweiss are cool.
So are the Roo's, Wabalies, and other ferals when you're playing Outback in the Simpson desert for a couple of months.

It's the Samperies that are a little hard to cope with.
Especialy when you've seen them up-close and personal ;)
Ugly and horid things - trust me :lol:

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

Hi Brenton

Thank you for your reply.

No problem in regards to the compilers.

Ok let’s get in to event driven architecture.

Bit cloud is the primary operation as it needs to make sure all RF links are as planned and my additional code will be a secondary issues. That’s fine…

I think I understand the need for event base, correct me if I am wrong. Say for example the Zigbee protocol needs to send some information every 10 secs, and I was to pulse a LED every 10 seconds as well. But with event based coding, the RF protocol would be executed first, and then LED. Yes there will be some delay after 10secs for the LED, but the RF link would be in tacked..

I hope this is correct?

Quote:
So the main control loop can keep track of exactly what is going on with timing and every IO line, you really shouldn't write to an IO port directly. Instead you should write to the main control loop (not necessarily main() (or a part of it) and tell it that you want it to toggle a line or move some data. But, you want to know when it has done this.

So in this case, I use the predefined functions to write to a pin, for example when I need to enable a DC-DC?

Quote:
To do this, you use what are known as "call-backs" and Bitcloud relies on this method.

Basically, instead of toggling an IO line yourself, you tell Bitcloud to toggle the IO line as soon as it can and when it has done that, you ask it to report back to you. Of course, it can only report back to you by jumping to a specific address you have given it (the call-back address) so that when the bit has been toggled, Bitcloud then runs your code again from/at the address you told it to. Hence the term, “call-back’.

Is there an example, for example on my application I am pulsing my DC-DC for 60 ms, when required. And I will read the ADC every time a End device wakes up. I am also thinking about using SPI or TWI to send data from a CORD to another AVR instead of using the USB.

So I short I am telling Bitcloud, when you are finished with all your crap, do me this task. And if something comes up which is important stop my task and do your important task and finish my task?

So how do I do this, is there a special way.?

When Bit Cloud completes our assigned task it lets us know, why does it do that? And not just get on with what I needs to do, is this just simple ACK message to us.

Quote:

Another way to think of “Event Driven “ code is to think of your main loop as being nothing more than being an empty while(1) loop, with the entire program being totally interrupt driven and having all of the flags and semaphores in place to ensure that one interrupt handler didn’t crash another and that everything just “happens” correctly. If you write your code in this fashion, you won’t have an issue with Event Driven programming, you may just need to shift your viewpoint, and if you can handle Event Driven programming you can create a program which just consists of a main(while1))) loop. Reality will often mean you will have a few things going on in your main_loop, but as you start to become more “event” or “interrupt” driven, your main() processes often become smaller.

So if everything is more a less event driven, then the main loop code will only execute if there is no other task?

Torby, you need to remove the old driver, and install the new driver. For this you do not need to worry about ISP and all that. It’s just getting windows to work. You could also click on update driver and use the new image.

Don’t worry to much about that cap.

Best Regards

DJ

Thanks

Regards

DJ

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

Yup. The old driver is gone. Now any time I try to install the new driver, it says, "Device cannot start (Code 10).

Grr... (I started to type "All Hail Bill Gates," when my mouse froze and I had to reboot again, so I'll not type that this time.)

The largest known prime number: 282589933-1

In my humble opinion, I'm always right. 

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

Try to install in safemode.

By the way once in installed it will show up not as USB port in device menu but under Port(COM and LPT)

Thanks

Regards

DJ

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

Yup. Even tried deleting the port. It's about an hour 'fore the other guys show up, so I'll play

I thought, if this doesn't work before long, maybe I'd try reinstalling the old one, just to see if I could.

The largest known prime number: 282589933-1

In my humble opinion, I'm always right. 

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

A result!

I schtuck the schtick into a computer that's never seen it before, and the found new hardware thingy came up. (I'm very technical.) When I navigated to the Bitcloud...\ThirdParty folder and selected the 6119_VCP.inf file, the silly computer said, "The specified location does not contain information about your hardware."

The largest known prime number: 282589933-1

In my humble opinion, I'm always right. 

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

Do this

Quote:
Ins
tall USB to Serial Converter driver. To install the driver, please attach the RZUSBSTICK device to your PC and wait for Windows to request for a specific driver for the device. If the RZUSBSTICK already has an assigned driver, or Windows assigned driver to it automatically, go to Start/Control Panel/System/Hardware/Device Manager, double-click the RZUSBSTICK device and select “Update Driver…”. Choose the “Install from a list or specific location” option and point to 6119.inf provided with this SDK. Please refer to section 4.9.1 of [8] for further details and basic troubleshooting option

Thanks

Regards

DJ

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

Thanks

Regards

DJ

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

So we've come full circle...

When I select the 6119_VCP.inf file, Windows tells me:

The specified location does not contain information about your hardware.

The PDF section 7, troubleshooting, sends me to section 4, setup, which sends me to section 8 that tells me ... which gets me to select the .inf file, which gets me to "The specified location does not contain information about your hardware."

The largest known prime number: 282589933-1

In my humble opinion, I'm always right. 

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

Maybe you can email atmel, i never had this issue, its problem because of windows.

Thanks

Regards

DJ

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

I did. Haven't heard from them yet.

I wonder if I need to reflash the stick 'cause the new driver isn't seeing something it wants in the old stick?

(This whole project has been a little this way. Instructions lead to something that doesn't work and leaves you hanging.)

The largest known prime number: 282589933-1

In my humble opinion, I'm always right. 

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

Well you can try, there should be in one of the folers a demo, there should be some bitlcoud hex files, add the CORD image and see.
Also when flashing them in, make sure all fuse are as needed.

Regards

DJ

Thanks

Regards

DJ

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

Ok. We're back in operation. I had to:

1. Reinstall AVR studio.

2. Reflash the USB stick from C:\DNLDS\AVR2017_RZRAVEN_Firmware\bin\rzraven_fw_images\RZUSBSTICK_no_bootloader.a90

3. Reinstall the Wireless Studio.

I am again able to send messages between my PC and my Ravens. I'm guessing is the newer driver didn't recognize the ancient code in my USB stick.

While I'm at it, I'll put a ISP connector on the second Raven.

The largest known prime number: 282589933-1

In my humble opinion, I'm always right. 

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

Hi DJ,

I'm having terrible Internet issues at the moment, so please excuse such a long delay between replies.

The Bitcloud stack needs total control of the CPU every 10 Milli-Seconds. If your code is taking 60 Milli-Seconds as per one of your previous messages, then you will be creating major issues. It may run, I don't know, but if it does, it may also cause you nothing but problems sometime in the future.

As for an example of call-backs and event-driven code, while not the best I've seen, it is somewhat explained in the Bitcloud documentation as is the (missing) Hardware Abstraction Layer.

Event Driven Programming is in doc8199 (section 3.1)
HAL is explained in doc8200 (section 6)

Hang-on a sec, weren't you telling me to read these documents and "all would become clear"?

You are supposed to have it working and were telling me to read the docs. I have read the docs and it doesn't make sense to me, but now I'm telling you where things are in the docs (which read before and is why I started posting here). This is starting to get scary.

Even after all of this, no-one has answered the simple question of weather they can get two Ravens (or Meshnetics modules) to talk to each other within the USB stick plugged into the PC.

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

Brenton_S15 wrote:

Even after all of this, no-one has answered the simple question of weather they can get two Ravens (or Meshnetics modules) to talk to each other within the USB stick plugged into the PC.

This question has been answered. Any module can take any role (Coordinator/Router/End device).

And piece of advice: why don't instead of writing big phony messages just ask particular questions you have. I'll be glad to answer questions but not accusations.

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

Hi Alex,

Thanks for the Good-News. This is encouraging.

Can you please tell me where the question has been answered and how to do it, because it really is not clear at all from any of the documentation or any of the messages here on AVRfreaks.

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

Brenton_S15 wrote:

Can you please tell me where the question has been answered and how to do it, because it really is not clear at all from any of the documentation or any of the messages here on AVRfreaks.

For two devices to talk to each other they need to be in the same network. To be in the same network there should be network coordinator. So one of devices must be setup to be coordinator and the second one can be either router or end device.

For sample applications from Atmel's web site there is Configuration file where you can specify role of any particular device (APP_DEVICE_TYPE parameter). For MeshBean boards you can also setup device role using dip-switches.

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

Dear Brenton

Do not be be scared.

Yes I did say that and I still stick by it.

In regards to 60ms, I have not yet had any issues but I will check it out.

Quote:

Even after all of this, no-one has answered the simple question of weather they can get two Ravens (or Meshnetics modules) to talk to each other within the USB stick plugged into the PC.

Could you kindly explain what you mean by within, or do you mean without.

I have told you before, that it is possilbe for two RAVEN to communicate. I have programmed one RAVEN as a CORD and another as an END, and the END joins the CORD with no problem.

Thanks

Regards

DJ

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

Seems to be a simple matter of making one of the ravens "coordinator." I'm hoping this thread progresses into how you do that and how you make the bitcloud code do it's work.

The largest known prime number: 282589933-1

In my humble opinion, I'm always right. 

Pages