Author Topic: EasyPIC-6 Development Board by MikroElectronica - Take"2"  (Read 41186 times)

Offline raynerd

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 2884
  • Country: gb
    • Raynerds Projects - Raynerd.co.uk
EasyPIC-6 Development Board by MikroElectronica - Take"2"
« on: January 30, 2010, 03:03:28 AM »
The other thread got polluted because of the issues with the video. There really is little of any use in that thread other than the mutal appreciation that Big Bro really is watching us! So here is "Take2" and hopefully some PIC programming related discussion to follow...?

Hi Guys

I got my EasyPIC 6 dev board a few days ago and I`m thrilled with it. It really is a super slick bit of kit! Ease of use is just immense! I had it running and programming within about 5 minutes of plugging it in and installing MikroC.

Here is my vid of a few clips of me playing around with the board and its functions:



I`m not going to do a huge review as there are already a few out there by people much more knowledgeable than me but I`m just going to mention some of the bits that I like ...

This board has an inbuilt COG LCD display so a display is always on hand:



It of course has the LCD port as well so you can have a second display (or more likely use the COG for debugging). Mikro only sell a 2 x 20 char display but I purchased a couple of 4x20 LCDs of ebay for about 5 and my mate soldered a standard IDE socket on the back - it plugs into the board just fine. You can see it in use in the video along with the COG.

It also has an expansion port, which obviously expands the number of available ports. As of yet I`ve never filled the available pins on a 40 pin PIC so have no use for it yet but it does the job. The COG is actually attached to this so you have to enable the expansion port to get the COG to work.

Also, the easyPic6 has the new matrix keypad which is a really smart extra! Along with the direction and button pad below. I am sure this will come in very useful and saves having to buy the add-on matrix pad.

It also has some "cool" improvements over the earlier models such as an ice blue "program" LED - which of course makes programming go much more smoothly   :lol:

I have just purchased the G-LCD with touch screen adaptor but as of yet I`ve not even plugged it in. I`ve heard very good things about it.

I have seen the Arduino development boards a few weeks ago and had the opportunity to play around with one for a couple of hours and for both ease of use and actual board content, the Mikroelectronica stuff blew it away in comparison - IMO!


Offline dsquire

  • In Memoriam
  • Hero Member
  • *****
  • Posts: 2275
  • Country: ca
  • Kitchener, Ontario, Canada
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #1 on: January 30, 2010, 03:39:04 AM »
Craynerd

It came through loud and clear across the pond. I'm going to follow this close as I want to play around a bit with some of this stuff. Just have to make up my mind and get started I guess.   :D :D

Cheers  :beer:

Don
Good, better, best.
Never let it rest,
'til your good is better,
and your better best

Offline raynerd

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 2884
  • Country: gb
    • Raynerds Projects - Raynerd.co.uk
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #2 on: January 30, 2010, 09:53:36 AM »
Don, I really advise you go for Mikroelectronica stuff, the Arduino stuff is popular but in my opinion, not as easy to use. The functionality of the EasyPIC is just amazing. I was in the very fortunate position that my friend is incredible in programming and has a number of development boards, I got the option to try a few out before I committed my money. I spent hours with Ardunio and hours with Mikroelectronica as well as some of the Chinese imports on ebay.

For 115, the EasyPIC 5 comes with a 16F887 PIC and USB cable and from there you only really need an LCD (5 for 4 line on ebay or 14 for 2 line!!?? from Mikro) and you have an amazing bit of kit. Infact, with the EP6 having the onboard COG LCD display, you don`t even need the add-on LCD.

I`m probably talking to a Professional programmer, Don, but if you are total noob like me, as you said you just need to go in and buy one. There is so much info and programmes on the web to get you going.

If you haven`t already, download the free MikroC programming software and give some coding a go.....that is presuming you want to go down the C route.

http://www.mikroe.com/download/c_pic_pro.php

It is free up to 2K of code (if you want a full version PM me and I`ll let you know the cheapest seller)

Chris
« Last Edit: January 30, 2010, 09:23:07 PM by craynerd »

Offline dsquire

  • In Memoriam
  • Hero Member
  • *****
  • Posts: 2275
  • Country: ca
  • Kitchener, Ontario, Canada
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #3 on: January 30, 2010, 03:57:05 PM »
Chris

Thanks for the reply and info.

Your partially right. I am a programmer. I once got a computer to say HI to me. Never did get paid for it so guess not a professional. :lol: :lol: :lol:

I have a couple of bit and pieces laying around here that I should dig out and what I really have. I know that I have a couple of displays and an assortment of chips and transistors etc. I don't have anything definite that I want to build, Just something to play around with when I feel like it. I am going to go and have a look at MikroC software and see what that is about. :D :D

Cheers  :beer:

Don
Good, better, best.
Never let it rest,
'til your good is better,
and your better best

Offline raynerd

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 2884
  • Country: gb
    • Raynerds Projects - Raynerd.co.uk
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #4 on: January 30, 2010, 09:37:48 PM »
Don, I don`t know how you managed to make 'head nor tail' of the message above. I think I was half drunk by the looks of it when I wrote it! I have since edited....anyway back on topic.

Although I am making my X-axis controller and now have plans for a Techo with built in display for all my machines, I didn`t really have much of a focus when I first looked into it. I know I was certainly so limited with my understanding when I first started that any efforts of a complex programe would have been impossible anyway.

In actual fact I`ve given the advice to you that infurated me when I got given it. The problem I had when I was told to download MikroC without the development board is that you can`t test your code and this really frustrated me!!  :bang:  That is why the dev boards are so good, you just re-program the chip and you can immediately test your changes. Since the PICs can be recoded 10,000 times and are only 4 for the best ones (1.00  for smaller models), you can test test test.

If you do have a go at writing some code after downloading Mikro C - download :
http://www.mikroe.com/zip/easypic6/easypic6_examples_v101.zip

and open the 16F887 examples folder and if you base your code around this PIC (887) I can easily blow it to the PIC for you and send you a short vid of how its working - from flashing an LED to a fully integrated 4 axis touch screen controller :) ... just email or post up the code.


Like you said, they are amazing to play around with even without a clear use for them! I`m currently trying a few projects including a binary clock based on a 32khz crystal, a 6x6 led matrix hopefully expanding to a 6x6x6 cube chaser and my X-axis controller. The first two being almost entirely pointless....but makes me happy  :headbang: :D :)

Offline j45on

  • Sr. Member
  • ****
  • Posts: 380
  • My tiny workshop Location Ashford Kent
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #5 on: November 07, 2010, 07:21:42 AM »
Sorry chris I know this is an old thread but I'm interested in buying an easypic kit
http://www.mcustore.com/pic-development-packs/1-easypic6-development-pack.html
And wonder if it is suitable for beginners ? IE: I know nothing  :scratch:
Jason

Offline kwackers

  • Sr. Member
  • ****
  • Posts: 356
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #6 on: November 07, 2010, 08:35:03 AM »
I use Mikro's stuff (including the easypic) for development and can highly recommend it.

Excellent libraries. Everything through multiplexed LED's, LCD's through blue tooth, GPS, memory cards, LAN etc etc. The add-on cards are cheap and functional, couple of library calls and your device can have it's own web page etc.
Well made boards.

I've used them to design and make lots of stuff, some commercial (yacht control system for example, using CAN based comms through 3 control boards driving a central PLU which controlled the yachts systems) and many other things.

The only downside is the C compiler isn't the fastest. But if that's an issue then you can uprate the processor (easiest) or nearly always re-think the algorithms to make them faster. Failing that you can always as a last ditch either write a section in assembler (or compile to assembler and lift out and optimise the relevant section).

With regards beginners, probably slightly harder to get up and running than Arduino (but easier to expand the hardware - everything just 'plugs in'), but much more capable in the long run. You can also pick the language you prefer, they have C, BASIC, Pascal etc.

I'd highly recommend them.
« Last Edit: November 07, 2010, 08:37:37 AM by kwackers »

Offline raynerd

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 2884
  • Country: gb
    • Raynerds Projects - Raynerd.co.uk
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #7 on: November 07, 2010, 12:21:04 PM »
Jason, it was Kwackers who introduced me to them and they are very easy to use almost straight from the box. The best thing in my opinion are the excellent code examples that come with it (or can be downloaded off their  website) for free. Using these it was possible for me to adapt and write my own codes quite quickly. I found I was quickly learning (kwacks may disagree :-p )  how to write code from scratch by modifiying their examples in previous attempts.

I`m totally presuming, but if you are like me and a TOTAL begginner then I don`t think there is one single fault with them and I can`t say that about many things I`ve purchased over the years. I`ve made a few stupid errors in hardware and still not managed to destroy it which is also unusual with me and electronics!

Like Kwackers said, the libraries are excellent because you just call on them and they work. For example I haven`t got the foggiest clue how a LCD screen works yet using their libraries I can really really simply use them with no trouble. OK - that is slightly ignorant of me, but at the moment and with the things I do, I`m just happy using them for now without actually knowing how they are running at a code level.

A friend of mine took it up just after I showed him what I had done with my EasyPIC. He has been doing it about 2 months less than me (9months ish) and using Assembler he can only do really really basic codes which take about twice the line space mine would. I therefore highly recommend C as well - once you get a grip and start using it, it is an excellent tool! I`m sure others may disagree or argue against what I`ve said but all I can tell you is I think that Mikro -C along with the EasyPIC 6 is an excellent excellent tool.

AND - I DONT work for Mikroelectronica lol   :D :) :)

Offline j45on

  • Sr. Member
  • ****
  • Posts: 380
  • My tiny workshop Location Ashford Kent
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #8 on: November 07, 2010, 04:47:55 PM »
Cheers guys  :nrocks:
I will have to wait until pay day now.
Will it need a PSU there is not one listed in the contents or any pic's
Jason

Offline raynerd

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 2884
  • Country: gb
    • Raynerds Projects - Raynerd.co.uk
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #9 on: November 07, 2010, 05:27:02 PM »
It has an ON/OFF switch and the possibility to power up the board from USB or external power supply.


Offline cidrontmg

  • Full Member
  • ***
  • Posts: 229
  • Country: pt
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #10 on: November 08, 2010, 10:27:11 PM »
Hi craynerd and kwackers, youve convinced me. I just ordered an EasyPic6, and some other boards from Mikroelektronika. And downloaded 109 Mb of files from their site... And ordered one 4x4 keyboard. Im also building the rotary table controller, and having a hard time trying to convince Farnell that I really would like to have their 4x4 kbd... I got most of the other components from Germany and Poland, just missing the 4x4 keypad. Im building the rotab controller into a Hammond/Eddystone cast ali box, big enough to also house a sizable PSU. And its a natural heat sink.
I dont know if I can use the Mikroelektronika keypad for it, electrically yes, but it doesnt seem very bombproof mechanically.  One possibility would be to decimate a pocket calculator and use that...
Ill take some pictures when I have a bit more to show.
Somehow funny that the EasyPic6 is made in Belgrade, Serbia, then it goes to the U.S.A., and then is sold to Portugal... And it would be more expensive if bought straight from Serbia! International trade and globalization work in mysterious ways.   :loco:
 :wave:
Olli
Penafiel
Portugal

Offline j45on

  • Sr. Member
  • ****
  • Posts: 380
  • My tiny workshop Location Ashford Kent
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #11 on: November 09, 2010, 04:18:12 AM »
cidrontmg
The key pad I got from farnell is made by apem if that helps
http://www.apemswitches.be/1-26725-Portugal.php

I also ordered an easypic 6 as well :ddb:
Jason

Offline raynerd

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 2884
  • Country: gb
    • Raynerds Projects - Raynerd.co.uk
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #12 on: November 09, 2010, 05:58:28 AM »
Please post your reviews! I`m quite excited now there are more of us that have one ... I`m still very much learning so it`ll be good to discuss issues with others!

Are you both going down the route of Mikro C for the programming?

I made a few good projects to get me going - a set of traffic lights (totally pointless!), I made a ball and cup game with an LCD display, a binary clock and my favourate one, which I actually built on an outside circuit was a little electronic dice. OK, all pointless really but they got me going with getting to grips with C and getting the skills to make my x-axis controller. I`m sure you`ll be better than me from the start but I had zero experience with any form of programming.   


 




Offline j45on

  • Sr. Member
  • ****
  • Posts: 380
  • My tiny workshop Location Ashford Kent
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #13 on: November 09, 2010, 07:19:48 AM »
Mikro C but the free version.
I can't justify 130 for software yet in case I can't figure it out.
Jason

Offline cidrontmg

  • Full Member
  • ***
  • Posts: 229
  • Country: pt
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #14 on: November 09, 2010, 10:37:04 AM »
Hi j45son, craynerd,
the Apem link helped, sort of. While I was trying to find a local vendor, I stumbled on a shop in Oporto that had 4x4 pads, not by Apem though, but cheap enough to check what theyre like. Hope to get a package this week.
Im not much of a C programmer. Basic and Pascal are far more familiar to me. Ive also done quite a bit of  x86 asm programming, but Im afraid its not much help. The instruction set of these CPUs is totally different. Ill see first what I can do with the free Basic and Pascal versions, the 2k limit seems rather low. The max. program size for 18F452 seems to be 32k. But in x86 assembler at least, you can do an awful lot in a 2k program. And maybe Im still able to learn Microchip asm...
 :wave:
Olli
Penafiel
Portugal

Offline j45on

  • Sr. Member
  • ****
  • Posts: 380
  • My tiny workshop Location Ashford Kent
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #15 on: November 10, 2010, 07:07:35 AM »
Postman has been  :ddb:

Jason

Offline kwackers

  • Sr. Member
  • ****
  • Posts: 356
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #16 on: November 10, 2010, 07:27:45 AM »
Wow! That was quick, whenever I order something from them it takes a couple of weeks!

Did you order it direct or via someone else?

Offline j45on

  • Sr. Member
  • ****
  • Posts: 380
  • My tiny workshop Location Ashford Kent
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #17 on: November 10, 2010, 07:47:32 AM »
Kwackers I ordered from it www.mcustore.com on Sunday or Monday night I forget which.
I can't wait to get home and play  :zap:
Jason

Offline raynerd

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 2884
  • Country: gb
    • Raynerds Projects - Raynerd.co.uk
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #18 on: November 10, 2010, 05:21:27 PM »
Kwacks, I ordered from them as well and was pleased with the quick delivery.

Ewwww... they have changed the box!! Mine is green!! Any luck with it?

Just got to figure all the jumper settings now and you`ll be off  :coffee:

Offline j45on

  • Sr. Member
  • ****
  • Posts: 380
  • My tiny workshop Location Ashford Kent
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #19 on: November 10, 2010, 07:05:29 PM »
Jumper settings ?
I think it came pre programed (the pic) it was doing a nice sweeping pattern with the leds when I fired it up
but I some how erased that  :lol: when I used mikro c
Mikro c loaded with a led flash program which I thought was the one the board was displaying so I changed the timing as indicated in the code but it was a different code.
I have ordered a book as I know absolutely bugger all about C
My trouble is I try to run before I can walk  ::)
Jason

Offline cidrontmg

  • Full Member
  • ***
  • Posts: 229
  • Country: pt
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #20 on: November 10, 2010, 10:37:25 PM »
Still waiting for my board, but actively downloading reading/learning/programming material. Im at 238 Mbs and 2020 files atm. No duplicates, afaik. This PIC business seems quite heavy on learning...  "The instruction set for the 16FXX includes 35 instructions in total", compared to the basic Intel x86, let alone to the x64, very very little.
I also downloaded the free MPLAB IDE from Microchip,
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en019469&part=SW007002
near the bottom of the page. It is an assembler programming environment, quite big at 103 Mb, but seems interesting. It runs in Windows machines, so I can try it without any PIC chips. Of course, I cant test the written code without something to run it on. I think Ill see what I can do with it (if anything), before trying the Basic/Pascal compilers. At least it doesnt have any limitations, and its free. Two very strong points in its favour...
 :wave:
 
Olli
Penafiel
Portugal

Offline j45on

  • Sr. Member
  • ****
  • Posts: 380
  • My tiny workshop Location Ashford Kent
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #21 on: November 11, 2010, 03:08:53 PM »
You guys have probably already found this one http://www.pictutorials.com/PIC_books.htm lots of free books

What other good learning resources are there ?
Jason

Offline raynerd

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 2884
  • Country: gb
    • Raynerds Projects - Raynerd.co.uk
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #22 on: November 12, 2010, 08:20:40 AM »
jason - jumper settings - all the jumpers that have to be set to the correct position for the different components of the board to work!? I find half that time that it isn`t my code that is wrong but the actual jumpers aren`t set correctly.

Have you downloaded all the examples? I presume the pic is the 16F877, in which case there is a hole host of C examples for the 877 that micro have made including the preprogrammed flashing LED curtain.

I have to say that I was shown most of what I learnt by a computer programmer which was an incredible help and would have struggled massively without, but the rest I learnt by modifying the Mirco C 16F877 examples.


Chris

Offline j45on

  • Sr. Member
  • ****
  • Posts: 380
  • My tiny workshop Location Ashford Kent
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #23 on: November 12, 2010, 03:26:51 PM »
Hi Craynerd I'm still reading lots of baffling stuff I have downloaded the examples and had a quick play with them
and I'm still waiting for some books to arrive this is going to be a very steep if not impossible learning curve for me
Jason

Offline kwackers

  • Sr. Member
  • ****
  • Posts: 356
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #24 on: November 12, 2010, 04:06:02 PM »
Start with something simple like the flashing LED example.

Don't worry too much about the code that sets up the PIC, just concentrate on the code that does the work.
Think you can see what it does?
Try flashing it at different rates.
Try flashing different LED's - more than one at a time.
Try changing the ON/OFF times.
Try flashing different patterns.
Finally try flashing lights on different ports (you'll need to start to see how the setup works).

Doing it this way you'll separate out the hardware (setting up the PIC) and the software. You can apply this to any of the examples, ignore the hardware and just concentrate on the 'core' software then eventually bring in the hardware.
The reason for this is that PIC's are very complex pieces of hardware, there's a lot in those little chips and you'll need to spend a fair bit of time with the data sheets and looking at the how to switch on and off the bits of hardware you need to use. For now I'd seriously avoid this otherwise you'll probably drown in the information available.

Offline raynerd

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 2884
  • Country: gb
    • Raynerds Projects - Raynerd.co.uk
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #25 on: November 13, 2010, 08:11:54 AM »
I started to drown very quickly when I was trying to setup the PIC, I suppose that is why I`m suggesting use the examples.

Like Kwackers said try an LED code.

Load up the LED curtain MikroC example and then you know that all the setup is correct to allow the LEDs to come on (i.e outputs set)

Then go down to the main code - delete it all and type in something like:

void main ()      // <-- this should already be in the example code
{
while (1)     // Loops the code because 1 is always true so keep cycling through it!
{
PORTC.b1 = 1;    // turns on PORTC  bit 1 = so the LED should come on
delay_ms (1000);   // delay a second
PORTC.b1 = 0;     // the LED will go off
}
}

I think that should work...??

Then like Kwackers said, try and get two to flash and that sort of stuff. Then I tried to make 1 of 6 flash at random so that I had a dice ... etc

Chris

Then you should have a flashing LED!!

Offline kwackers

  • Sr. Member
  • ****
  • Posts: 356
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #26 on: November 13, 2010, 08:44:25 AM »
Sorry Chris, there's a bug in it...

you turn the led on,
wait one second
turn the led off
go back to the beginning.

See the problem?
The time take to go back to the beginning is in the order of a microsecond so the led won't be off for very long...

You can either add an extra 'off' delay after turning it off,
or
if you're happy with the on and off times being equal simply 'invert' the state of the bit
eg
Code: [Select]
while (1)
{
    PORTC.b1 = !PORTC.b1;  // ! means 'not' i.e inverts the bit
    delay_ms(1000);
}

(shorter too)
« Last Edit: November 13, 2010, 08:49:09 AM by kwackers »

Offline raynerd

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 2884
  • Country: gb
    • Raynerds Projects - Raynerd.co.uk
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #27 on: November 13, 2010, 09:16:38 AM »
Yep...see that now :D

Which is why the EasyPIC is so good - me being a numpty would have loaded that to the PIC and then found it didn`t work! :D

void main ()      // <-- this should already be in the example code
{
while (1)     // Loops the code because 1 is always true so keep cycling through it!
{
PORTC.b1 = 1;    // turns on PORTC  bit 1 = so the LED should come on
delay_ms (1000);   // delay a second
PORTC.b1 = 0;     // the LED will go off
delay_ms(1000) // EDIT !!! EXTRA DELAY ADDED!
}
}

Offline j45on

  • Sr. Member
  • ****
  • Posts: 380
  • My tiny workshop Location Ashford Kent
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #28 on: November 13, 2010, 09:35:49 AM »
Chris you think you are a numpty I managed to order completely the wrong book I ordered programming microcontrolers in assembly instead of C  :lol: that makes me a propper numpty  :doh:
I shall try your bit of code later
Jason

Offline j45on

  • Sr. Member
  • ****
  • Posts: 380
  • My tiny workshop Location Ashford Kent
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #29 on: November 13, 2010, 02:10:07 PM »
I think I have broke it  :scratch:
I plugged in the board and switched it on and it was running the led curtain code from the library
I started a new project and copy n pasted the code above in and hit the build and program button
now I have nothing so I tried programing the curtain code nothing again so I tried the led blink and the 2x16 lcd one nothing works now
I have not changed any jumpers or switches since I bought it
The power,usb and pgr/icd leds sugest something is going on
I have tried it with and without the lcd,reset it removed and replaced the pic and still nothing  :zap: what have I done ?
Jason

Offline kwackers

  • Sr. Member
  • ****
  • Posts: 356
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #30 on: November 13, 2010, 02:18:05 PM »
Unlikely you've broken it.

Make sure when you program it that there are no error messages, then check the code has 'taken' using the verify option.
Make sure you haven't inadvertently flipped any of the dip switches, make sure the crystal is in place etc.

Presumably you're powering it from the USB?

Offline j45on

  • Sr. Member
  • ****
  • Posts: 380
  • My tiny workshop Location Ashford Kent
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #31 on: November 13, 2010, 02:36:57 PM »
Phew got it working again seams to have been when I started a new project I have now managed to get the led curtain code working again  :ddb:
I cant get craynerds bit of code to do anything if I delete the code on screen and paste in his it compiles with no errors but wont do anything on the easypic.
I am using usb should I not ?
Jason

Offline kwackers

  • Sr. Member
  • ****
  • Posts: 356
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #32 on: November 13, 2010, 03:05:31 PM »
Shouldn't need much, there was no direction set in Chris's code - try this.

Code: [Select]
void main()
{
  TRISC = 0x00;          // set direction to be output
 
  while (1)
 {
    PORTC.b1 = 0;        // Turn OFF LED 1 on PORTC
    Delay_ms(1000);      // 1 second delay

    PORTC.b1 = 1;        // Turn ON LED 1 on PORTC
    Delay_ms(1000);      // 1 second delay
  }
}

Offline j45on

  • Sr. Member
  • ****
  • Posts: 380
  • My tiny workshop Location Ashford Kent
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #33 on: November 13, 2010, 03:19:02 PM »
 :nrocks: thanks that works
why are RC0 and RC2 led's iluminated there is nothing in the code  :scratch:
Jason

Offline Bluechip

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 1508
  • Country: england
  • Derbyshire UK
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #34 on: November 13, 2010, 04:16:47 PM »
:nrocks: thanks that works
why are RC0 and RC2 led's iluminated there is nothing in the code  :scratch:

Have a shufti at the .pdf data sheet, PortC pin functions for the uC you are using.

Most port pins have several uses, in fact I think they all do, apart from Xtal Osc pins ...

Could be something like an 'OSCOUT' or the like ... depends on the Config set-up...

Happens to me all the time ...  :loco:

WTF is it doing NOW???    , is my favourite mantra ..

Dave BC
I have a few modest talents. Knowing what I'm doing isn't one of them.

Offline j45on

  • Sr. Member
  • ****
  • Posts: 380
  • My tiny workshop Location Ashford Kent
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #35 on: November 13, 2010, 04:27:47 PM »
WTF is it doing NOW???

strangley I have said that a lot tonight as well  :lol:

This is about the most constructive thing I have managed to do
Jason

Offline Bluechip

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 1508
  • Country: england
  • Derbyshire UK
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #36 on: November 13, 2010, 04:33:24 PM »
Jason

Which PIC is it ??

Assume it is a PIC ..

Dave BC
I have a few modest talents. Knowing what I'm doing isn't one of them.

Offline kwackers

  • Sr. Member
  • ****
  • Posts: 356
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #37 on: November 13, 2010, 05:11:42 PM »
If you want to be really clever, connect your stepper drivers 'clock' input to b1 of portC.
Your stepper motor will now step 1 step each second.

By changing the value in the delay you can change how fast it steps (reducing it will make it step faster).

Then by using a counter to only do it so many times you've essentially got a simple divider!

e.g.

Code: [Select]
void main()
{
  int count;                // variable we'll use to count

  TRISC = 0x00;          // set direction to be output

 for (count = 0; count < 400; count++)  // step 400 times
 {
    PORTC.b1 = 1;        // Turn ON clock pulse
    PORTC.b1 = 0;        // Turn OFF clock pulse

    Delay_ms(10);      // 10 mS delay (about 100hz)
  }
}

Notice there isn't a delay between turning on the clock pulse and turning it off - this is because it only needs to be high for a tiny amount of time in order to be recognised by the driver.

Offline j45on

  • Sr. Member
  • ****
  • Posts: 380
  • My tiny workshop Location Ashford Kent
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #38 on: November 13, 2010, 05:12:51 PM »
It is the pic that came with the easypic 6 KIT

PIC16F887-I/P
Jason

Offline Bluechip

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 1508
  • Country: england
  • Derbyshire UK
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #39 on: November 13, 2010, 05:42:34 PM »
Ah! got 2 of them ...

Just looked at the data sheet for PortC, P58 is interesting.

All sorts of magic stuff on RC0, RC2.

You might check the bits set in the registers on that table.

Any one ending in xxxxxCON could be be incompatible with what you're doing.

It may be configged for Osc out, Comparator out  or PWM.

Just a thought ... could well be nowt relevant in there.

Dave BC
I have a few modest talents. Knowing what I'm doing isn't one of them.

Offline raynerd

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 2884
  • Country: gb
    • Raynerds Projects - Raynerd.co.uk
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #40 on: November 14, 2010, 04:20:43 AM »
Jason...

Sorry, my fault again. I just sent those instructions and little bit of code in my head. I forgot they set the direction of the ports in void main ()

One thing that mucked me up for hours and hours was that when you open a new code for example from the MikroC examples, you need to go File --> open --> Change - File Type  to MikroC PROJECT !!   If you open just the C file it won`t build.


Code: [Select]
void main() {

  [color=red]ANSEL  = 0;                                    // Configure AN pins as digital
  ANSELH = 0;
  C1ON_bit = 0;                                  // Disable comparators
  C2ON_bit = 0;
  
  TRISA = 0x00;                                  // set direction to be output
  TRISB = 0x00;                                  // set direction to be output
  TRISC = 0x00;                                  // set direction to be output
  TRISD = 0x00;                                  // set direction to be output

  PORTA = 0x00;                                  // turn OFF the PORTD leds
  PORTB = 0x00;                                  // turn OFF the PORTD leds
  PORTC = 0x00;                                  // turn OFF the PORTC leds
  PORTD = 0x00;                                  // turn OFF the PORTD leds[/color]

 while (1) {
    for (counter = 0; counter < 8; counter++){
      PORTA |= 1 << counter;
      PORTB |= 1 << counter;
      PORTC |= 1 << counter;
      PORTD |= 1 << counter;
 
      wait();
    }
      
    counter = 0;
    while (counter < 8) {
      PORTA &= ~(1 << counter);
      PORTB &= ~(1 << counter);
      PORTC &= ~(1 << counter);
      PORTD &= ~(1 << counter);
      wait();
      counter++;
    }
  }

Yea, sorry I`ve just pulled up the example code for the LED curtain above. All the stuff in red is the PIC setup so my intention was for you to keep that in, I forgot that was in main so you deleted it.

How about trying this as a bit of an extension. I don`t know the correct explanation, one of the others will explain in more detail but this always blew me away because it makes it feel like your code is less computer like and more English!

Go right to the VERY TOP line of the code (it makes it simple if we put it here) and write:

Code: [Select]
#define LED1 PORTC.b0
#define LED2 PORTC.b1


Now PORTC.b0 and b1 can be called (defined) as LED1 and LED2 in the code!

Code: [Select]
while (1)
{
LED1 = 1;
LED2 = 0;
delay_ms(1000);
LED2 = 1;
LED1 = 0;
delay_ms(1000);
}    

Think that should work OK...the point is, rather than talking about PORTC.b1 your now talking about Button 1 or LED1 or MotorX in the code. OK, only a simple text substitution, but it impresses me!

« Last Edit: November 14, 2010, 07:53:53 AM by craynerd »

Offline DMIOM

  • Hero Member
  • *****
  • Posts: 676
  • Country: gb
  • Isle of Man
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #41 on: November 14, 2010, 07:06:00 AM »
I think I have broke it  :scratch: .....

Jason, glad that you're now sorted.

I don't use the MikroElectronica boards or IDE, but a more general PIC-related "gothcha" are the fuses - these are outside your actual program but they configure various features of the PIC.

One that can be a show-stopper, and give symptoms just like you had experienced, is the setting that tells the PIC which clock source - can be an external xtal, an actual external oscillator, a ceramic resonator, an external RC network or maybe an internal oscillator.  Despite having a perfect program, if that fuse wrongly set, then absolutely nothing will happen as there'll be no ticks ... 

Another fuse gotcha is if you inadvertently enable the watchdog timer ("WDT").  The WDT is a safety feature designed to catch programs that get stuck in an un-expected loop - you have to tickle it periodically to let it know you're still alive (the WDT acts just like the dead-man's handle in a loco cab).  If you find your program starts OK and then keeps re-starting its always worth checking if you have an un-expected WDT active. 

Last fuse to pay attention to (as it can cost $) are the code protection fuse(s). DON'T set this unless you really mean to!  If, like us, you manufacture and sell kit which uses embedded PICs, and the code is your intellectual property, you want to prevent un-scrupulous potential competitors cloning your kit, then when all is fully debugged, the production PICs are programemd with the CP fuse set - this stops anyone reading them and can also have the side-effect of preventing you from re-programming them yourself.

Dave

Offline j45on

  • Sr. Member
  • ****
  • Posts: 380
  • My tiny workshop Location Ashford Kent
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #42 on: November 15, 2010, 07:41:53 AM »
Cheers guys  :thumbup: I shall have a play tonight.
Call of duty black ops took over my weekend  ::)
Jason

Offline kwackers

  • Sr. Member
  • ****
  • Posts: 356
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #43 on: November 15, 2010, 09:17:04 AM »
Could have got you that cheap  :wave:

Offline raynerd

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 2884
  • Country: gb
    • Raynerds Projects - Raynerd.co.uk
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #44 on: November 15, 2010, 10:29:16 AM »
Call of duty black ops took over my weekend 

 :doh: :bang:

Offline j45on

  • Sr. Member
  • ****
  • Posts: 380
  • My tiny workshop Location Ashford Kent
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #45 on: November 15, 2010, 03:11:34 PM »
Thanks Chris
that works a treat it certainly helps simplify things a bit  :beer:
I now have a flashing letter J made from led's on my board  :ddb:
« Last Edit: November 15, 2010, 03:32:24 PM by j45on »
Jason

Offline raynerd

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 2884
  • Country: gb
    • Raynerds Projects - Raynerd.co.uk
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #46 on: November 15, 2010, 03:42:22 PM »
Have you tried using variables yet?

Code: [Select]
int count = 0;
 
while (1)
{

count = count + 1       // adds 1 to the variable count

if (count >= 500)        // CHANGE the number Count is counting to!
{
count = 0;                 // when it does get to this number it`ll go back to zero
PORTC = ~PORTC;      // ...and flip PORTC either on or off.
}
}

See if that works - again, not got my EasyPIC board with me! I`m sure "~" flips the value from 1 to 0 or vice versa.

EDIT - by the way, the whole point of that is that your getting a delay using a variable and counting. Suprisingly useful!

EDIT 2 - have you used inputs yet?
« Last Edit: November 15, 2010, 03:44:43 PM by craynerd »

Offline j45on

  • Sr. Member
  • ****
  • Posts: 380
  • My tiny workshop Location Ashford Kent
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #47 on: November 15, 2010, 04:02:14 PM »
No I have not tried any of that yet I have only fiddled with the examples so far and the last bit of code you posted.  :thumbup:
I was hoping to have the book I ordered this weekend gone but I ordered the wrong one  :doh:
And I have been reading a book on C but it's aimed at computer programming and not microcontrolers.
There seams to be a lack of really basic beginners tutorials on the net for stuff like this
Jason

Offline kwackers

  • Sr. Member
  • ****
  • Posts: 356
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #48 on: November 15, 2010, 04:09:40 PM »
Books on assembler aren't really a dead loss since they'll allow you to get a feel for the hardware.

The most complex thing with PIC's is the hardware. Each pin on a PIC is multifunction, it may have an analog to digital converter, RS232, CAN, USB, SPI or a whole host of functionality as well as its ability to operate as a standard digital input or output.
Each of these requires that the mode the pin is operating in can be setup, and each mode requires registers set up to tell it how to behave.

That's why the examples can be useful to base your stuff on, find one that uses similar hardware to you and simply modify the code inside main after the hardware has been set.

Once you get the hang of the hardware then the programming is just standard C - it doesn't need to be PIC specific (although Mikro C does have some of it's own 'extensions' along with appropriate libraries for the hardware.

What all this means is you can use the assembler book to try and understand the hardware, but any C programming tutorial to understand the C language.

Offline Bluechip

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 1508
  • Country: england
  • Derbyshire UK
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #49 on: November 15, 2010, 05:48:33 PM »
I got 'Designing Embedded Systems with PIC uControllers' from Amazon some weeks ago. Lots of example code for asm. and C18.

Starts pretty much from Sq. 1

Found it very helpful.

About 22 ish

Nice thick heavy  book. ( Also good for the flattening the spine of books on the scanner ....  :thumbup: )

Would like to find one with some stuff for Hi-Tech C, but not much luck.

C18 don't do 16Fxx chips. Which is a bit of a bummer, 'cos I was given quite a number ...  :scratch:

Dave BC

I have a few modest talents. Knowing what I'm doing isn't one of them.

Offline cidrontmg

  • Full Member
  • ***
  • Posts: 229
  • Country: pt
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #50 on: December 15, 2010, 05:47:24 PM »
Hi, finally got my EasyPic6 yesterday. Not all of the stuff I ordered, but at least the main board. Rest coming later (hopefully). Tried compiling some (Basic) code, and got it to do funny flashing LEDs, and text on the COG2x16 display. This is a neat thing. Reminds me strongly of the first computer I built, many years ago. S-100 bus, Z-80 CPU, 2 boards of 8k of static RAM, a cassette tape for mass storage, and a B/W TV, where I fed the output directly to the cathode. No keyboard, just toggle switches on the front panel.... And an enormous amount of ICs on the boards (all TTL logic). Powered with an old IBM transformer, also would be good for spot welding. And two Mallory 25000 mF (not micro-F, - thats really 25 Farads...) caps... Admittedly, EasyPic6  is a bit more sophisticated. Theres a learning curve looming ahead, I hope its not a vertical wall when I hit it.
 :wave:
Olli
Penafiel
Portugal

Offline Bluechip

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 1508
  • Country: england
  • Derbyshire UK
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #51 on: December 15, 2010, 06:15:27 PM »
Hi Olli

Doubt if they're really 25 farad ... On some German PSU's I worked on some caps were marked as 68,000 mF.

However, in The Parts Listing they were described as 68mF, and on the wiring diagram as 68,000uF.

I've no idea why they should be so marked, 'cos it's not correct. But not unknown.

Cannot imagine why anyone would want a cap. of that size for ripple rejection?

Tried a search on the type number, probably on it?

Dave BC

« Last Edit: December 15, 2010, 06:19:29 PM by Bluechip »
I have a few modest talents. Knowing what I'm doing isn't one of them.

Offline DMIOM

  • Hero Member
  • *****
  • Posts: 676
  • Country: gb
  • Isle of Man
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #52 on: December 17, 2010, 12:04:43 PM »
...... On some German PSU's I worked on some caps were marked as 68,000 mF

Possibly that'll be the difference is symbology - the Brit . for decimal and comma for thousands - versus the continental European use of the comma for decimal separator?

Dave

Offline cidrontmg

  • Full Member
  • ***
  • Posts: 229
  • Country: pt
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #53 on: December 17, 2010, 09:16:10 PM »
Hi Bluechip, I cant be sure they really were 25F, I had no way of testing/measuring them. But Im fairly sure they were. They came from a scrapyard (as did the transformer), and they looked more like car batteries than ("normal") electrolytes. In a rectangular plastic case (there was metal underneath, but not exposed). And with copper screw-on terminals instead of the leaden studs. And nowhere near as heavy as batteries. Quite huge things. I dont think they ever were in a (mainframe) computer PSU, or even near a computer (or a PSU of any sort), but they came cheap (same as any ali scrap), and had all the capacitance I could ever wish for. 25000 mF, 25 volts.
Theyre not with me any more, a friend was building a capacitor discharge welder, and he talked me into giving them away for that project. I dont know how successful the project turned out, but if not, it certainly was not because of too small caps.
BTW. The same scrapyard had lots and lots (several hundred, I imagine, in a huge pile) of keyboards, which were practically unobtainable elsewhere then (1977-78). But he couldnt sell them, he had a list from IBM about what bits he could sell, and what not, that really had to be crushed and scrapped. And no matter how nicely I tried to convince him of letting me have one, no way. Same thing with ribbon (flat) cables. Not one meter could I pry off him.
 :wave:
 


Olli
Penafiel
Portugal

Offline Bluechip

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 1508
  • Country: england
  • Derbyshire UK
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #54 on: December 18, 2010, 10:04:52 AM »
Dave

I'm aware of the , / . thing. They were in fact 68,000 uF. We had to change a good few. Why? Because they were rated at 40VDC Wkg. Fine. Except the off-load DC volts of that PSU @ 240VAC input was >51V. Not much 'Vorsprung Durch Technik' about those then  .... The Spec called for 63VDC Wkg. so how someone thought 40VDC was OK is anyones guess. Entertaining bang when they let go anyway ..  :lol:

Olli

Only said it was unlikely, not impossible ..  :thumbup:

If they were as big as a car battery, it may be that's what they were. I worked for IBM for 16 years. Biggest I ever saw on a CPU , IIRC, was 250,000 uF @ 7.5 VDC. There were 6 in parallel on a 2.18V (?) PSU fitted to the System 7 CPU. About 70mm dia. x 150mm . May well have been larger caps. on machines I had no dealings with.

The narkiest ( not IBM ) was 2200uF @12kV. Like a young Wheelie Bin. Off some sort of Radar transmitter IIRC. Not the sort of thing to discharge with a screwdriver ..

IBM were/are very sensitive about spare parts going walkies. I think they don't want them to go to third party maintainers .. Naturally ..

If they were the transparent ribbon cables, they have a fair bit of silver in them ... IIRC.

Off to my freezing shop ... finish sorting out the screw junk pile ... I can feel the excitement and enthusiasm building up now ... NOT

Dave BC



I have a few modest talents. Knowing what I'm doing isn't one of them.

Offline buffalow bill

  • Jr. Member
  • **
  • Posts: 86
  • Country: scotland
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #55 on: September 24, 2011, 05:51:39 PM »
Hi everybody, how are things progressing. Would you still recommend the EasyPIC-6 over an Arduino?

Bill
Helensburgh, Argyll & Bute

Offline raynerd

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 2884
  • Country: gb
    • Raynerds Projects - Raynerd.co.uk
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #56 on: September 24, 2011, 06:43:00 PM »
Hi Bill

I recently purchased 12 Arduino boards for use as a class electronics/programming "club" at school. They are cheap, infact on ebay I paid 35 each for board, LCD display, nearly 100 components (LEDS, resistors, IR sensor, IR remote...), 100 connection wires, USB lead and a little box to put it all in! Sketch, the compiler is a free download for the full version and there is so much on the net already developed for arduino that within 2 minutes I was off and running with sample code, 20 minutes up and running with simple codes I`d written and after an hour, I was doing some persistence of vision stuff that was way above my head but I just copied the code and circuit diagram off the net!

All that said, I`m currently working on a clock timing machine to time my new clock when it is setup. I couldn`t do it with the Arduino board as it didn`t give me the functionality needed and more than that, after using the EasyPIC6 on this project for the last few weeks it really is a dream to use and in my opinion well worth every penny.

My humble opinion - if you want to "play" at it, for 35 you just can`t beat the arduino but the EasyPIC6 really is a fantastic piece of pro kit and gives you the flexibility and speed to write and edit code very quickly, without the faff of breadboard circuits!

I know there are a few on here which are much better at coding than me and I`m sure they will give you there more experience opinion! 

Offline dickda1

  • Full Member
  • ***
  • Posts: 161
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #57 on: September 24, 2011, 08:28:50 PM »
How did I miss this thread till now! :doh:

I own an EasyPIC5 and BigPIC5.  Used both in an engineering course I used to teach about 5 years ago.

Mikroelectronica stuff is simply the best.  Inputs and outputs from the PIC processor are nicely provided.  I use their pascal compiler.  Microdevices has nice boards, but not nearly as good as these.  If you feel compelled to learn assembler, these Mikro boards are the place to do it.

Bought both directly Belgrade because it was much cheaper than I could get from the east coast here in the States.  Don't know how they manage to sell stuff so cheaply.  Always thought it was ironic to buy something from a city only about 10 years after it was being bombed by NATO.

-Dick
sunny (mostly) San Francisco, land of looney people, sane politics and occasional earthquakes.
Skype: VladTheChemist

Offline soli20

  • Newbie
  • *
  • Posts: 2
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #58 on: September 28, 2011, 07:55:23 AM »
could any one help me in my project

Offline dickda1

  • Full Member
  • ***
  • Posts: 161
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #59 on: October 02, 2011, 12:58:33 PM »
Soli20,

What family of processor are you intending to use?  

While there are knowledgeable electronics guys on this site, you might be better off asking on a micro forum.  Check out links on this page:
http://www.eng-tips.com/viewthread.cfm?qid=219971&page=2
-Dick
sunny (mostly) San Francisco, land of looney people, sane politics and occasional earthquakes.
Skype: VladTheChemist

Offline raynerd

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 2884
  • Country: gb
    • Raynerds Projects - Raynerd.co.uk
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #60 on: October 02, 2011, 02:51:10 PM »
could any one help me in my project

What actually is your project???????  :doh:

Offline Bluechip

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 1508
  • Country: england
  • Derbyshire UK
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #61 on: October 02, 2011, 03:16:45 PM »
could any one help me in my project

What actually is your project???????  :doh:

According to his other post, he's doing a robot .. narrows it down a bit ... maybe...

BC
I have a few modest talents. Knowing what I'm doing isn't one of them.

Offline John Rudd

  • Hero Member
  • *****
  • Posts: 2258
  • Country: gb
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #62 on: October 02, 2011, 03:41:27 PM »
could any one help me in my project

I already posted in his other thread asking what experience he had et-al.....

Maybe I missed his reply? :scratch:

What actually is your project???????  :doh:
eccentric millionaire financed by 'er indoors
Location:  Backworth Newcastle

Skype: chippiejnr

Offline matnewsholme

  • Jr. Member
  • **
  • Posts: 38
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #63 on: October 03, 2011, 02:48:26 PM »



My humble opinion - if you want to "play" at it, for 35 you just can`t beat the arduino but the EasyPIC6 really is a fantastic piece of pro kit and gives you the flexibility and speed to write and edit code very quickly, without the faff of breadboard circuits!

I know there are a few on here which are much better at coding than me and I`m sure they will give you there more experience opinion! 

Chris

do you think the power feed you did last year could be implemented on an arduino board? been playing with arduino for a few weeks and want to do something similar to what you did.

Mat

Offline raynerd

  • Madmodder Committee
  • Hero Member
  • *****
  • Posts: 2884
  • Country: gb
    • Raynerds Projects - Raynerd.co.uk
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #64 on: October 03, 2011, 03:14:32 PM »
Mat, The power feed could definately be done on the arduino, infact, Kwackers who visits here, the chap that made the rotary table divider code, has been working on a 3 axis power feed for the arduino. In other words, a three axis controller!!

I`m only playing with arduino at a very basic level and I must admit I`m quite a bit better with the Mikro stuff despite them apparently being similar! I guess if your use to coding, the syntax is the same but when your not really use to it, the difference between the two is vast in my opinion!
The basics of the code I used was to have a pulse in an interrupt.

void interrupt(){
if (modeRun = 1)   //do we want to move the motor
PORTA.b1 = 1; // pin high to the stepper controller
delay   // have a v short delay
PORTA.b1 = 0; // pin low


Then I had it so that in the main code something like:

if (goButton)         // if we press the go/start button
modeRun = !modeRun    // flip modeRun on and off - i.e press button, motor runs and again it stops.

if (directionButton)   // if we press the direction button
PORTA.b2 = !PORTA.b2  //direction flips between on and off, left and right



---------

I literally had something like that wrote down for my first code. Infact, I bet you could do with without the interrupt just to test it:

main code {
if (goButton)         // if we press the go/start button
modeRun = !modeRun    // flip modeRun on and off - i.e press button, motor runs and again it stops.

if (directionButton)   // if we press the direction button
PORTA.b2 = !PORTA.b2  //direction flips between on and off, left and right

while (modeRun)    //when modeRun is on
{
PORTA.b1 = 1; // pin high to the stepper controller
delay   // have a v short delay
PORTA.b1 = 0; // pin low
}

Then just hook it up and see!

Offline matnewsholme

  • Jr. Member
  • **
  • Posts: 38
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #65 on: October 03, 2011, 03:59:06 PM »
cheers Chris

finally got round to mounting stepper on x-axis on my X3 as first stage of cnc conversion. initially just want to use it as powerfeed so arduino linked to stepper driver seems way to go. want to use a pot for speed selection so modifying one of sample arduino sketchs as a quick and dirt proof of concept. If I feel brave I might try and convert your code across to arduino (not sure how it handles interrupts yet - more reading needed  :scratch:)

Mat

Offline kwackers

  • Sr. Member
  • ****
  • Posts: 356
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #66 on: October 05, 2011, 05:17:43 AM »
Hi Mat,

I'm part way through doing something similar to what you suggest, but sadly it's a 'stalled' project due to a complete lack of time at the moment...

If it's any help this code sets up two lots of interrupts, a mpg (int on pin change) and a timer. Here's the code for them both.

Steve.

Code: [Select]
 

const int MPGALine = 20;
const int MPGBLine = 21;

int AState = 0;            // mpg vars
int BState = 0;


// timer interrupt handler
ISR(TIMER2_OVF_vect)
{
  // some code
}


void setup()
{
  // init timer interrupts
  // timer2 settings: Prescaler / 256, WGM mode 0
  TCCR2A = 0;
  TCCR2B = 1 << CS22 | 1 << CS21;

  // timer2 Overflow Interrupt Enable
  TIMSK2 = 1 << TOIE2;

  // reset timer
  TCNT2 = 0;

  // setup the MPG interrupts

  pinMode(MPGALine, INPUT); // int 3
  attachInterrupt(3, mpgAChange, CHANGE);

  pinMode(MPGBLine, INPUT); // int 2
  attachInterrupt(2, mpgBChange, CHANGE);
}


//-----------------
// mpg interrupt handler

void mpgAChange()
{
  AState = digitalRead(MPGALine);
  if (AState != BState)
    CurrentPosition += MPGMultiplier;
  else
    CurrentPosition -= MPGMultiplier;
}

void mpgBChange()
{
  BState = digitalRead(MPGBLine);
  if (BState == AState)
    CurrentPosition += MPGMultiplier;
  else
    CurrentPosition -=  MPGMultiplier;
}



Offline dickda1

  • Full Member
  • ***
  • Posts: 161
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #67 on: October 05, 2011, 10:30:18 PM »
If using an Easydriver or Pololu stepper driver or even a simple H-bridge be careful to watch the current draw.  A small/medium stepper motor like an M23 is right at the upper limit for these popular microprocessor-powered drivers - even with a good heat sink and a fan.

I built a stepper motor controlled laser for a DAVID 3D laserscanner.  The duty cycle was low so that the driver could cool down.

-Dick
sunny (mostly) San Francisco, land of looney people, sane politics and occasional earthquakes.
Skype: VladTheChemist

Offline matnewsholme

  • Jr. Member
  • **
  • Posts: 38
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #68 on: October 06, 2011, 12:55:46 PM »
Kwackers

cheers for the interrupt code. will give it a try when I get that far.

dickda1

not going to drive stepper directly from arduino board. using arduino to generate step/direction signals for a proper stepper driver.

Mat


Offline dickda1

  • Full Member
  • ***
  • Posts: 161
Re: EasyPIC-6 Development Board by MikroElectronica - Take"2"
« Reply #69 on: October 06, 2011, 03:26:36 PM »
Mathewsholme,

I didn't state it well.  The arduino board can't usually source enough current to drive anything but a very small stepper.  That includes the plugin motor driver boards.

Keep us informed as your project progress.  I am interested.

Dick
sunny (mostly) San Francisco, land of looney people, sane politics and occasional earthquakes.
Skype: VladTheChemist