Several problems PIC AI/Necto

Fully featured PIC compilers available on Windows, Linux, and macOS.
Post Reply
Author
Message
MarkEE
Posts: 32
Joined: 26 Feb 2007 02:42

Several problems PIC AI/Necto

#1 Post by MarkEE » 20 Feb 2022 19:58

I've been using the Pro Compiler legacy systems for years. I own all of the C PIC, ARM DsPIC etc. compilers,VTFT and several dev boards. All have served me well for professional use.

I just recently made a major upgrade purchase which includes
MikroC PIC AI compiler
MikroC PIC32 AI compiler
Fusion for PICV8
EasyPIC V8
3", 4" and 7" TFTs and about 6 MCU cards.

First, let me say thank you for NOT providing a discounted upgrade path for any of that, especially the compilers. I've read that you only provided that for a limited time period. Ridiculous.

I am having a multitude of problems. I will address just one here to make it simple as it might provide some insight to the others.

On the EasyPIC V8, I just wanted to get a simple LCD module up and running in Necto as a start of a new project. I cant get it to work.

It is a Legacy project (I have no use for SDK). I enabled the 2 LCD libraries and cant get this simple code to run. I have tried several processors including the default 18F47K42. The cores seemed to be up and running and stable.


/// LCD module connections
sbit LCD_RS at RA3_bit;
sbit LCD_EN at RB1_bit;
sbit LCD_D4 at RB2_bit;
sbit LCD_D5 at RB3_bit;
sbit LCD_D6 at RB4_bit;
sbit LCD_D7 at RB5_bit;

sbit LCD_RS_Direction at TRISA3_bit;
sbit LCD_EN_Direction at TRISB1_bit;
sbit LCD_D4_Direction at TRISB2_bit;
sbit LCD_D5_Direction at TRISB3_bit;
sbit LCD_D6_Direction at TRISB4_bit;
sbit LCD_D7_Direction at TRISB5_bit;
//// End LCD module connections

void main(void)
{
Lcd_Init(); // Initialize LCD
Lcd_Cmd(_LCD_CLEAR); // Clear display
Lcd_Cmd(_LCD_CURSOR_OFF); // Cursor off
Lcd_Out(1,1,"Hello");

while (1)
{ }

}

I suspect it has something to do with an I/O layer or something as I seem to be missing signals from portb on the scope. Yes, I did set all as digital and all special functions disabled. Any ideas?

I even tried making a hex with the old Pro compilers in an attempt to get it uploaded to the V8 board using CodeGrip Suite. It doesn't work. The chip doesnt seem to write properly at any speed. Can you shed some light on this before I spend hours trying to figure out why?

Also let me comment that not providing an LCD contrast control for either of these V8 boards is nuts, especially considering the price tags. And, why fix the LCD power level at 5V and not provide a simple switch for 3.3???? Incredible. I'm going to have to build my own backpack board to accomplish this.

Im sorry if I sound irritated but Ive been working on this for nearly 2 weeks and am way behind schedule. I would appreciate any thoughts here.

Toley
Posts: 922
Joined: 03 Sep 2008 16:17

Re: Several problems PIC AI/Necto

#2 Post by Toley » 20 Feb 2022 20:55

Hello MarkEE,

You have invest a lot of money in mE products, I hope they will give you good after sale service!
Did you try the example that comes with the compiler?

As a cue I will suggest you to use LAT for pin definition. Good luck.

Code: Select all

sbit LCD_RS at LATA3_bit;
sbit LCD_EN at LATB1_bit;
sbit LCD_D4 at LATB2_bit;
sbit LCD_D5 at LATB3_bit;
sbit LCD_D6 at LATB4_bit;
sbit LCD_D7 at LATB5_bit;
Serge T.
Learning is an endeless process but it must start somewhere!

MarkEE
Posts: 32
Joined: 26 Feb 2007 02:42

Re: Several problems PIC AI/Necto

#3 Post by MarkEE » 21 Feb 2022 02:09

Toley,
Thank you for the suggestion. I did try that previously but just tried it again. No dice unfortunately.

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Several problems PIC AI/Necto

#4 Post by filip » 21 Feb 2022 15:04

Hi,

Can you please add the following at the top of main function and see if this helps ?

Code: Select all

  ANSELA = 0;                        
  ANSELB = 0;
  
  // LCD BCK PWM control
  TRISC.B2 = 0;
  LATC.B2 = 0;
Also, turn on Lcd backlight switch and PWM switch SW6.3 and SW6.4 and make sure that CAN switch is toggled to up position (GPIO position) RB3/RB2.

Regards,
Filip.

MarkEE
Posts: 32
Joined: 26 Feb 2007 02:42

Re: Several problems PIC AI/Necto

#5 Post by MarkEE » 22 Feb 2022 02:14

OK, I am partially up and running.
I knew about the CAN switch and the SF configurations. Thank you for the suggestion but that wasn't it.

In the confusion I think I inadvertently fried the driver chip in one module while working on the contrast issue, so when I tried Toley's suggestion of changing the syntax of the definitions to ...
sbit LCD_RS at LATA.B3;
sbit LCD_EN at LATB.B1;
sbit LCD_D4 at LATB.B2;
sbit LCD_D5 at LATB.B3;
sbit LCD_D6 at LATB.B4;
sbit LCD_D7 at LATB.B5;
sbit LCD_RS_Direction at TRISA.B3;
sbit LCD_EN_Direction at TRISB.B1;
sbit LCD_D4_Direction at TRISB.B2;
sbit LCD_D5_Direction at TRISB.B3;
sbit LCD_D6_Direction at TRISB.B4;
sbit LCD_D7_Direction at TRISB.B5;

it didnt appear to work. I tried another module and that didn't work either. I think it was actually working but again, contrast. I didnt see it. I made contrast mods to that module just now and that is now up and running. Thanks Toley, you were right! The example in the Legacy library doc was incorrect.

Anyway, to add more to the confusion the target chip for this project is a 18F26K80 which I can only get the LCM partially working. It responds to commands but wont show text via Lcd_Out(). I have a blinking cursor which I can switch on and off. I'll figure that out eventually. I''ll probably take a little time and write my own LCD library to give me more control.

I noticed on my Easypic V8 that the pull-up/dn dip switch for PORTB is defective. Several of the switches do not click and appear loose. This is a brand new board that I just received from Digikey. I dont think that has anything to do with this though. Its just irritating.

Again sorry for the confusion. I do a LOT of embedded work and always juggling jobs so I have a LOT of LCD Modules around all requiring different contrast voltages. Thank you for your help.

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: Several problems PIC AI/Necto

#6 Post by filip » 28 Feb 2022 12:30

Hi,

Have you managed to get this working ?

Regards,
Filip

Post Reply

Return to “PIC AI compilers”