PDA

View Full Version : EasyPIC5 recommended project sources



manwolf
- 10th June 2008, 02:36
Just getting started learning PIC development. I have both the LAB-X1 and the EasyPIC5 development boards. I bought the LAB-X1 as a kit to work the rust out of the cogs. While trolling the forum I notice a few members liked the EasyPIC boards so I decided to order one.

So far I have Blinky and Blink 8 LEDS in sequence running on both boards with 2 different PICs, both exercises are from the LAB-X1 manual. I had to modifiy them to work on the EP5.

Can any of the members point me to some exercises that work on the EP5. Maybe I missed something in the docs or on the CD but I haven't found any yet. I don't mind porting over but it adds another error level I could do without while learning the PIC environment.

PBP, MPLAB, and MicroCode.

Ted

mackrackit
- 10th June 2008, 03:03
Have you seen this page?
http://www.melabs.com/resources/samples.htm
It is not for the EasyPic5...but you may get some ideas.

Acetronics2
- 10th June 2008, 08:24
Hi, Manwolf ...

For EasyPic 5 you'll have to DEFINE :

- Oscillator speed to 8 Mhz ( HS ...), if onboard XTal used
- Pins used by EP5 are very specific ... so you have to meet this Pin use.
- MicrocodeStudio can directly interface EP5 ... There's a thread about that in those columns.

http://www.picbasic.co.uk/forum/showpost.php?p=54069&postcount=3

For "soft" purposes ... now, it's you to make your brain work ...

Alain

manwolf
- 10th June 2008, 22:51
Thanks for the tips and links, I have been coding in MCS and then running PICFlash on its own. Always good to put the brain to work keeps the cobwebs cleared out. I will check out both of the links.

Now all I need to do is unlearn all of my bad habits from programming PCs. LOL

What does everyone suggest for a simulator, the one in MPL or something like PIC Sim?

mackrackit
- 10th June 2008, 22:58
What does everyone suggest for a simulator, the one in MPL or something like PIC Sim?
I do not trust simulators, do a search on this forum and you can find suggestions. The one with MPLAB I hear is pretty good... But BreadBoard101 still works great :)

mister_e
- 10th June 2008, 22:59
I'll suggest you the best one...
NOTHING

Build your circuit and that's it. There's no valuable Hardware Simulators on the market.

Some are better... but they all failed my own simple test. Save thousands bucks and build your own circuit...Period.

I know i'll make friends... once again ;)

manwolf
- 11th June 2008, 00:56
I'll suggest you the best one...
NOTHING

Build your circuit and that's it. There's no valuable Hardware Simulators on the market.

Some are better... but they all failed my own simple test. Save thousands bucks and build your own circuit...Period.

I know i'll make friends... once again ;)


someone get upset with sweet and nice mister_e no way ;o)

mister_e
- 11th June 2008, 01:53
Believe me there is... do I care when it's because I gave my own opinion on something?

http://www.mister-e.org/Pics/N_http://www.mister-e.org/Pics/O_

Freedom's of speech all the way :D with decent moderation though...

rmteo
- 11th June 2008, 02:02
Here is a low cost simulator (available for PIC16 and PIC18) that is fun to use:
http://www.oshonsoft.com/pic.html

It has a decent range of hardware peripherals, is low cost and the BASIC compiler is very similar to PBP. You can try it for free (with no limitations) for 30 days.

Copy'nPaste
- 11th June 2008, 18:33
Hey manwolf,
ALL of the PBP examples should work on EP 5, once you have changed/removed the includes that set up the fuses, OTHER than the LCD examples that write to the CG ram.
On the mE boards the RW pin is hardwired to Vss.
Until now I haven't seen any mE examples that write to the CG ram.
And I agree, the best sim is a soldering iron and/or a bread board!

manwolf
- 12th June 2008, 04:53
Here is a low cost simulator (available for PIC16 and PIC18) that is fun to use:
http://www.oshonsoft.com/pic.html

It has a decent range of hardware peripherals, is low cost and the BASIC compiler is very similar to PBP. You can try it for free (with no limitations) for 30 days.

Downloaded that and have been trying out seems pretty complete. I have run a couple of their examples just to watch the ports and registers in action. It has helped get my head around the chips.


Thanks Copy'nPatse
So far I have been able to run most ME stuff on the EP5, that is until I tried the first LCD example. SO far I have not been able to get either board to display a thing.


'************************************************* ***************
'* Name : Hello.BAS *
'* Author : Ted Crafton *
'* Notice : Copyright (c) 2008 PROGRAM SPECS *
'* : All Rights Reserved *
'* Date : 6/10/2008 *
'* Version : 1.0 *
'* Notes : *
'* : *
'************************************************* ***************
CLEAR
DEFINE LCD_DREG PORTD
DEFINE LCD_RSREG PORTE
DEFINE LCD_RSBIT 0
DEFINE LCD_EREG PORTE
DEFINE LCD_EBIT 1
DEFINE LCD_RWREG PORTE
DEFINE LCD_RWBIT 2
DEFINE LCD_BITS 8
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 20

TRISD=%00000000
TRISE=%00000000

ADCON1=%00000111

LOOP:
LCDOUT $FE,1
PAUSE 250
LCDOUT "HELLO"
LCDOUT $FE,$C0
LCDOUT "WORLD"
PAUSE 250
GOTO LOOP
END


This is the LAB-X1 code, then I got distracted by the missing backlite resistor. Turns out the LCD does not have a backlite. Then the real world(work) came crashing in, so I haven't dug any further and not willing to say uncle yet. I'll dig in it tommorrow.


If I didn't want opinions I wouldn't have joined a forum, so bring them on. The skin is thick and the ego was buried years ago. If you don't break it, you ain't trying hard enough.

malc-c
- 12th June 2008, 08:23
So far I have been able to run most ME stuff on the EP5, that is until I tried the first LCD example. SO far I have not been able to get either board to display a thing.


DEFINE LCD_DREG PORTD
DEFINE LCD_RSREG PORTE
DEFINE LCD_RSBIT 0
DEFINE LCD_EREG PORTE
DEFINE LCD_EBIT 1
DEFINE LCD_RWREG PORTE
DEFINE LCD_RWBIT 2
DEFINE LCD_BITS 8
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 20



That's because the LCD on the EP5 uses port B not port E. Try



DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 4
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 5
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50



This works with the 2 x 16 LCD that MikroElectronica supply with the EP5

Acetronics2
- 12th June 2008, 08:36
That's because the LCD on the EP5 uses port B not port E. Try



DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 4
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 5
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50



This works with the 2 x 16 LCD that MikroElectronica supply with the EP5

Hi, MW

those lines work fine with all the "classical" HD 44780 compatible devices ...
may be some special characters are different ... but it works !

Now, for learning you can download an old EPE paper about "intelligent LCDs" (Feb / March 1997 issue )

Alain

manwolf
- 13th June 2008, 00:16
Its aaaamazing but it you never load the program on the chip the LCD stays blank. DUH!!!

I loaded my LED program instead of LCD. So the LEDS were blinking, but the LCD was blank. With the LEDS blinking I figured the problem was either in my code or the LCD.

Mal-c>
I was working with the ME board, but thanks for the tip. EP5 next. the first time I tried, I used PORTA figured I had the wrong one, so I decided to get it working on the ME board first to make sure my code was ok.

mister_e
- 13th June 2008, 00:46
Try their demo .HEX files.. if it doesn't work.. it's a good sign you have something else wrong... easy enough to screw some jumper settings in their board... same rules if you forgot to adjust the contrast pot...