Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

New toy!

Status
Not open for further replies.
Hi again,

Mosaic:
What got my attention was the price. If you shop around you can get whole dev boards for Arduino for the same price as one PIC chip.

Nigel:
The main thing about C is the data types. You have to always be aware of what data type your variable is and how the instructions will handle that data type. That's the main thing really. Everything else is just a function call really.
But the Arduino IDE really gives you more functionality because of an implementation of C++ rather than just C. So you get to use C++, and many of the libraries use this anyway.
The C++ library has advantages like function overloading, encapsulation.
The only down side is that the C++ language for Arduino may not support all of the C++ language. I think the 'new' command is not supported, which would be a bother to people who are coming from Windows programming. I think this may be because of the resources 'new' may use up on the small uC chip (RAM). That's unless they changed this.
But as long as you keep track of the variable types and their byte use i think you will be happy :)
For a few examples:
byte A=2; //a single 8 bit number
int B=2; //a single 16 bit signed number (15 bits plus 1 sign bit)
long C=2; //a single 32 bit signed number (31 bits plus 1 sign bit)

Obviously we have to be aware of the memory space because if we try:
A=0xF0;
B=0x10;
C=A+B;

we get an overflow condition in the C variable, which may or may not be planned on. Here the result would be C=0 which we might want or not. If we dont want overflow, then we have to go to a larger data type like 'int' or 'long' or an unsigned version of either of those.
For those same lines if they were all declared as 'long', we would get instead:
C=0x100;

rather than zero.

I am not really done testing the Arduino yet though.
 
Last edited:
I have a nano somewhere, hard to let go of the tight asm/hardware relationship though. It's the engineer in me I guess.
 
Hi again,

Yes it's hard to give that up, but then you dont really have to you can keep that too :)

Despite having an Uno for almost a year now, i have not done a real lot with it except for a few small things and havent tested it that well yet either. I did test something yesterday though that was very interesting.
Using the Arduino IDE and a simple program modified slightly for faster operation, i was able to get the full port speed, which turned out to be quite amazing and showed me something very interesting about the Atmega 328P chip (and maybe others).
That is, the full port speed can go as high speed as the oscillator frequency clock, without any division factor (except of course the instruction time) like the low end PIC's have (instruction time plus division by 4 overhead). You have to make sure you have the right variable for the port and also the right bits, but that's not difficult for someone coming from pure ASM.
This is one of the tests i should have done a long time ago. The 328P chip is capable of executing instructions that take only one clock cycle (1/16e6 second for a 16MHz crystal) which means that i can toggle the port bits at a rate of very near or at 4Mhz (two instructions for the port, one for a jump back to start) whereas with the PIC i think the fastest is 1MHz simply because each instruction on the PIC takes 4 oscillator cycles.
In fact, the writeup for the 328P chip states 1MIPS per MHz, so that means it executes 16 million instructions per second compared to the PIC 4 million per second with the same clock speed. At least with the lower end chips, maybe the higher end chips are faster though.
Of course you cant stick to the Arduino level of abstraction, but it's not too hard to get around and keep the rest intact. I need this for something i am looking into for a friend currently. Also, i might need it for something i want to do later too with a display that needs a lot of serial bits sent out repeatedly, which could take a lot of time with the built in digitalWrite() "Arduino" port bit wrapper function.

One thing i still havent tested yet though is the accuracy of the A to D converter. I would like to compare it to the low end PIC chips ADC to see if there is any difference. I suspect that some or all of these Arduino type boards do not have a direct line to the ground nearest the ADC input pins of the chip itself or the reference input. I'll have to see how much difference that makes. It might be possible to solder a small wire directly to the pin though if needed, but i didnt want to have to do that as these chips are small sometimes.

There is one other small advantage:
If you want to program a chip or build something for a customer or a friend and you want them to be able to upgrade the firmware easily, you can send them a Nano (for example) and since it already has a USB connector all they have to do is plug it in and upload the sketch, assuming they download the IDE of course. Since more and more people are becoming more technically savvy, we will probably see this kind of thing more often in the future.

I still like my PIC chips though :) If Microchip or someone else could come up with an IDE like Arduino only for the PIC chips, that would be something amazing and i would probably turn to that.
I also made a lot of stuff with the PIC already which i wont be giving up too soon.
 
Last edited:
The 328P chip is capable of executing instructions that take only one clock cycle (1/16e6 second for a 16MHz crystal) which means that i can toggle the port bits at a rate of very near or at 4Mhz (two instructions for the port, one for a jump back to start) whereas with the PIC i think the fastest is 1MHz simply because each instruction on the PIC takes 4 oscillator cycles.

Then choose a PIC that has an on-board clock multiplier, which is presumably what the AVR uses :D
 
I still like my PIC chips though :) If Microchip or someone else could come up with an IDE like Arduino only for the PIC chips, that would be something amazing and i would probably turn to that.
I also made a lot of stuff with the PIC already which i wont be giving up too soon.
Have you thought of moving up the scale..... The Arduino nano is no smaller than the pinguino micro..

Diligent have a pic32 "Arduino style" development system... I have been playing with ChipKit for some time now
https://chipkit.net/
There is also Amicus18 which uses Proton Basic...

In fact if you look there are quite a few...
 
Then choose a PIC that has an on-board clock multiplier, which is presumably what the AVR uses :D

Hi,

What is the price compared to a lower end PIC?
 
Have you thought of moving up the scale..... The Arduino nano is no smaller than the pinguino micro..

Diligent have a pic32 "Arduino style" development system... I have been playing with ChipKit for some time now
https://chipkit.net/
There is also Amicus18 which uses Proton Basic...

In fact if you look there are quite a few...

Hi,

Doesnt look too cheap. How much for one board?
 
Doesnt look too cheap. How much for one board?
I'm paying around £11 for "one offs".. When I buy bulk they will be around £8.30... Remeber that these are HUGE in comparison....

I can run colour LCD's with no issue's atall....

Hopefully I'll be making one into an Android controlled hovercraft starting on Monday!!!
 
The 16F1827 has an on-chip multiplier, and is cheaper than the other usual PICs.

Hi Nigel,

I have to say that i am impressed with this chip selection. I looked at the data sheet a little and found that the effective max oscillator frequency is 32MHz, which is quite impressive for a low end chip, or can we even call it a low end chip, except for the price which is a low end price which of course is always nice. So that means the effective instruction rate is 8MIPS, which is 2 times the 328P chip
I also see a DAC, which is a nice addition, as well as onboard voltage reference.

I guess there are other things to compare too though, such as the flash memory space which is a little small (7kB) but at least it still has the EEPROM.
Still pretty nice.
 
I'm paying around £11 for "one offs".. When I buy bulk they will be around £8.30... Remeber that these are HUGE in comparison....

I can run colour LCD's with no issue's atall....

Hopefully I'll be making one into an Android controlled hovercraft starting on Monday!!!

Hi Ian,

So we're talking about 15 bucks USD. Not too bad i guess.
I guess i was kind of sticking to the somewhat lower end chips/boards because they have so much functionality for the cost. I considered going to a 32 bit platform, but never got around to it. Most of the stuff i do these days is basic stuff like battery chargers, charge controllers, etc. My most advanced project for the year will be a Tablet multimeter, interfacing a uC with the Tablet for various kinds of measurements, like an "all in one" meter for volts, amps, ohms, esr, frequency, etc. That's all kind of basic stuff really, and the Tablet will do some of the work (in whatever language i end up using for that) so it's effectively a combination of platforms (uC+Android).
 
My most advanced project for the year will be a Tablet multimeter, interfacing a uC with the Tablet for various kinds of measurements, like an "all in one" meter for volts, amps, ohms, esr, frequency, etc. That's all kind of basic stuff really, and the Tablet will do some of the work (in whatever language i end up using for that) so it's effectively a combination of platforms (uC+Android).
That's how I intend the Hovercraft to work... The "Good Ol" HC06 bluetooth module connected to the pinguino and two motors.... I have managed to get Andriod and pinguino talking... Pretty good distance as well!!
 
I have to say that i am impressed with this chip selection.

I know, they impressed me when I found them, and I've now moved totally to the enhanced mid-range series - higher spec, easier to use, more facilities, and a considerably lower price :D

I also find internal oscillators VERY useful, they are mostly more than accurate enough, and gives you more I/O and more board space.
 
That's how I intend the Hovercraft to work... The "Good Ol" HC06 bluetooth module connected to the pinguino and two motors.... I have managed to get Andriod and pinguino talking... Pretty good distance as well!!

How about some pictures of how it's coming along?, and of course video when it's working :D

You've got to love hovercraft :p
 
How about some pictures of how it's coming along?, and of course video when it's working :D

You've got to love hovercraft :p
Dead right!! I have some really old project encyclopedia's... There is a really good hovercraft project at the end of one of them... I'll just need to beef up the fans to lift the PCB and batteries ... The HC06 module has a real decent range so it'll work good as a remote!
 
I tried to hook my Samsung Note2 to my Laptop via Bluetooth... No deal!!

I bought several HC06 boards from Ebay... Connected one to an Arduino, I always have lying about, And it worked straight off the bat... I soon had a servo motor and several LED's under complete control from my phone..

I have registered on the MIT APP Inventor 2 website and I can develop anywhere ( Its not installed on a PC, Its completely online )

I should imagine you could do tons with them!!
 
I tried to hook my Samsung Note2 to my Laptop via Bluetooth... No deal!!

I bought several HC06 boards from Ebay... Connected one to an Arduino, I always have lying about, And it worked straight off the bat... I soon had a servo motor and several LED's under complete control from my phone..

Do you buy the serial interface ones?, or just the normal ones?

I have registered on the MIT APP Inventor 2 website and I can develop anywhere ( Its not installed on a PC, Its completely online )

I should imagine you could do tons with them!!

Probably - but as it stands I never really use Bluetooth at all (although as I mentioned, I might do now it's built-in my new PC).

I might just order some :p
 
Do you buy the serial interface ones?, or just the normal ones?
They are the serial ones... According to the news.... People are dropping contraband into prisons using quadcopters and a smartphone... Like I said... You can do tons with them
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top