PDA

View Full Version : EasyPic 6 Mikroelectronika



Stargazer3141
- 13th April 2020, 21:29
Does anyone have any experience with this development system using PBP? I am a newbie, and I am trying to use a Pic16F628A to write to the on board LCD screen. It appears to be connected to port B - can't seem to get it to work. Can anyone send a simple sample program that might work?
Thank you for any help.

richard
- 14th April 2020, 06:00
i have an ep7board it appears to be very similar to a ep6 schematically for the lcd connections. i have experienced no trouble with the lcd. only issue i have using those old style chips is getting the programmer to verify chip. iirc the pgm pin needs to pulled down for success.

you provide no detail and can't get it to work is pretty vague.
what have you tried ? and what happens ?

Stargazer3141
- 14th April 2020, 16:06
It appears that the LCD is connected to Port B. I think by default the PIC 16F628A uses Port A. I just do not know how to tell the PIC to use Port B. What PIC are you using with Easypic 7? I was hoping someone could send me the pic basic code that would provide me with a simple test.

Stargazer3141
- 14th April 2020, 16:23
my code looks like this:

CMCON = 7
DEFINE LCD_DREG PORTB
DEFINE LED_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



PAUSE 1000
LCDOUT $FE,1
LCDOUT "HELLO"
PAUSE 1000

END

Stargazer3141
- 14th April 2020, 17:31
oops - correcting a typo and an omission - this is the code that I am trying

TRISB=0
CMCON = 7
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



PAUSE 1000
LCDOUT $FE,1
LCDOUT "HELLO"
PAUSE 1000

END




Thank you for any help

richard
- 14th April 2020, 23:59
i don't see why that will not work , assuming the pic config you have omitted showing is correct

can you blink a led ?


this works fine for a 648a , a 628a's rich brother

'************************************************* ***************'* Name : LCD_TEST.BAS *
'* Author : RICHARD *
'* Date : 4/8/2017 *
'* Version : 1.0 *
'* Notes : pic16f648a ep7 *
'* : 2016 LCD *
'************************************************* ***************
#CONFIG
__config _INTOSC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_OFF & _MCLRE_ON & _BODEN_ON & _LVP_OFF & _DATA_CP_OFF & _CP_OFF
#ENDCONFIG

DEFINE OSC 4


'LCD defines begin here
DEFINE LCD_BITS 4 'defines the number of data interface lines (4 or 8)
DEFINE LCD_DREG PORTB 'defines the port where data lines are connected to
DEFINE LCD_DBIT 0 'defines the position of data lines for 4-bit interface (0 or 4)
DEFINE LCD_RSREG PORTB 'defines the port where RS line is connected to
DEFINE LCD_RSBIT 4 'defines the pin where RS line is connected to
DEFINE LCD_EREG PORTB 'defines the port where E line is connected to
DEFINE LCD_EBIT 5 'defines the pin where E line is connected
DEFINE LCD_COMMANDUS 1500 'defines the delay after LCDOUT statement
DEFINE LCD_DATAUS 50 'delay in micro seconds
'END of LCD DEFINES

Pause 500 ' LCD initialize time
lcdout $FE,1
LCDOUT $fe,$83,"HELLO"
LCDOUT $fe,$c8,"World"
stop
end

ps rb4 must be pulled low if using ep7 on board programmer or else pgm load will never verify

Stargazer3141
- 16th April 2020, 10:05
Yes I can flash an LED - no issues with programming or compiling this code - just does not work for me.

richard
- 16th April 2020, 10:34
Yes I can flash an LED - no issues with programming or compiling this code - just does not work for me.


starting a new tread with the same problem , not even with any extra info probably will get you no further.
yes pbp defaults to porta for lcd thats why the defines are used , the defines overwrite the defaults

what are your config fuse settings ?
what version of pbp are you using ?
did you try my code ?

richard
- 16th April 2020, 10:38
i assume you ep6 is connected like this

8828

Stargazer3141
- 16th April 2020, 11:29
Sorry abt the second thread - just getting frustrated!
I did try your code but did not work - I know your code must be solid so maybe it is a fuse setting or a hardware issue?
I am using PBP 3.0.8.0 compiler with the mikroProg suite as my software. It lets you set the config bits when you load the hex file. My config bits set the oscillator as internal, watchdog timer enabled, power up disabled, master clear enabled, brown out detect enabled, low voltage program disabled, Data EE disabled. I can flash an LED so I know the PIC is good and everything is working on that end.
Thanks so much for taking the time and energy to help - I will try again tomorrow.

Stargazer3141
- 16th April 2020, 11:30
My connections are just like you printed

Stargazer3141
- 16th April 2020, 11:34
Could the fuse settings be an issue? What software do you use to program your Easypic7? I could not get microcode studio to work with it - it does not seem to be able to find the board.

richard
- 16th April 2020, 11:56
Could the fuse settings be an issue?

it often is that or failure to set pins to digital, its not the code thats a problem. i assume the contrast is not an issue and that the lcd works and the ep6 board is undamaged and has no conflicting jumper/switch settings




What software do you use to program your Easypic7?
I could not get microcode studio to work with it - it does not seem to be able to find the board.
8829

command line use for the mikro onboard icd doesn't seem to be a possibility, its not going to run from the msc button.
i just load the hex file manually , if you compile my code the config fuse settings are embedded in the hex file
there is no need to set them

you could upgrade to 3.0.10 for free

richard
- 16th April 2020, 12:13
you realise there are two 18pin skts on the board for different chip pinouts, you need to use the proper one

Stargazer3141
- 16th April 2020, 23:48
i set my pins to digital using cmcon=7 , but I think that only sets Port A to digital. By default, is port B digital? Do I need a command to do that?
I will try your code again tonight - thank you so much for your help!

Stargazer3141
- 16th April 2020, 23:49
I do realize there are two sockets - i am using socket B, and I can flash an LED so I think it is set up correctly

richard
- 17th April 2020, 01:45
i set my pins to digital using cmcon=7 , but I think that only sets Port A to digital. By default, is port B digital? Do I need a command to do that?

the code I posted sets up everything necessary to use the lcd. only porta has analogue attributes and plays no part in this exercise
cmcon=7 will disable the comparator module and set porta pins to digital mode on that chip


I do realise there are two sockets - i am using socket B, and I can flash an LED so I think it is set up correctly

but can you set each and every portb pin needed for lcd to flash a led and do they flash at the set rate,

the problem is not the lcd code

richard
- 17th April 2020, 04:40
just a thought , you're not trying to use the built in cog serial lcd are you ?

8841

Stargazer3141
- 18th April 2020, 00:35
Not using the serial LCD

richard
- 18th April 2020, 00:54
ok then its back to simple fault finding

1. can you verify portb pins 0 to 5 actually work
2. do pins b0 to b5 get to the lcd socket
3. are pins b0 to b5 shorted to something not intended
4. does the lcd have power,gnd and contrast connections that work
5. does the lcd even work

Sherbrook
- 19th April 2020, 15:19
Hi stargazer

I think you have the defines for the LCD wrong. Have a look at the schematic in the user manual for the LCD. You will see that portb.0 to portb.3 is connected to the HIGH four data bits of the LCD.

Change
DEFINE LCD_DBIT 0
to
DEFINE LCD_DBIT 4

Check that the LCD has power (I think you have to set a switch or jumper). Your LCD should burst into life.

Phil

Stargazer3141
- 20th April 2020, 20:31
I am delighted to report success! Well, sort of. Richard - you started me thinking about a possible hardware issue so I started snooping around with my meter. On the LCD pins, I was seeing some very strange readings - pins shorted together, etc. I upgraded to an Easypic 7 and used your code, and it works like a charm. Not sure why my easy pic 6 was damaged - I barely used it - been sitting in a drawer. BTW with the easy pic 7 that was a great tip about pulling RB4 low - chip will not program unless it is held low ( not sure why?)

Thanks so much for taking the time to help me!

richard
- 21st April 2020, 10:12
not quite the solution i expected , still you're up and running