Author Topic: trouble with 2 x 16 ldr and pic  (Read 1280 times)

0 Members and 1 Guest are viewing this topic.

Offline neko efecktzTopic starter

  • Regular Contributor
  • *
  • Posts: 153
  • Country: au
trouble with 2 x 16 ldr and pic
« on: May 21, 2016, 06:34:17 am »
Please help me if anyone can. This may get lengthy.
I think I have bitten off more than I can chew.
About me...
I'm 63 years old and not getting any younger.
Total newbie to pics.

A few weeks ago I decided to look into programming a few Pics to drive a 2 x 16 LCD.
I have done some visual basic programming (many years ago) but decided to go the full hog and buy a Pickit 3 clone and learn C.
How many versions of C are there?
While I waited for it to arrive I downloaded MPLAB X IDE.
I found that it has no or very little support for 2 x 16 LCD so I uninstalled it and found it didn't uninstall completely. It left a few folders and files behind. These are outlined in a previous post.

I installed Microchip XC8 v1.37 and with a little help managed to get it running.
I have so far been unable to get a program to work.
I have downloaded complete projects including header files etc and still get errors.

I have watched videos and using the Windows Snipping Tool (very handy tool) pause, copy / past to word and then printed it so I could type the code in.

Just about every line in the code has an error mark in the line number column.
Most of them have a message when I hover the mouse over the error flag like
Unable to resolve identifier Nop.
Unable to resolve identifier SetDDRamAddr.
When I try to build the program I always seem to get 2 errors that always seem to be the same.
A snap shot included.

I have also copy/pasted displayed files with the same results.

My main idea is to have the Pic monitor various parts of my power supply.
It comprises of two power supply boards running from 2 separate transformers i.e.
two completely separate Monitoring
   Over current in both positive and negative supplies taken from the current limit led circuit.
   Variation of over say .25 volts between supplies using a window comparator
   Heat sink temperature etc. Or at least over temperature.

Every input will have an Opto Coupler for full isolation.

The chips I have had for a few years bought in a bulk lot of components are PIC 16F84 20meg.
Once I get a couple of projects working I will buy bigger and more versatile chips and try to do silly things like read the voltages and temperature and have this displayed and perhaps even a tiny speaker as an alarm just in case I don't see there is an alarm condition.

Silly question but if I downloaded an earlier version than XC8 v1.37 would this help me get all of the required header files etc ?
If so what would be a good version to try?

I eagerly await any help I can get.
 

Offline kripton2035

  • Super Contributor
  • ***
  • Posts: 2603
  • Country: fr
    • kripton2035 schematics repository
Re: trouble with 2 x 16 ldr and pic
« Reply #1 on: May 21, 2016, 06:37:51 am »
may be you could try some simplier IDE like the mikroe one here : http://www.mikroe.com/mikroc/pic/
or even their basic ide is nice
there are libraries for the lcd and full help built in ...
and they are free to use until you reach 2K of code, for an lcd drive it should be ok
 
The following users thanked this post: neko efecktz

Offline Skimask

  • Super Contributor
  • ***
  • Posts: 1433
  • Country: us
Re: trouble with 2 x 16 ldr and pic
« Reply #2 on: May 21, 2016, 07:01:36 am »
Did you buy the PIC16F84 or the PIC16F84A?

Try compiling for the 16F84A instead and see what happens.
Knowing Microchip, they probably forgot to add/remove/fix something for the 16F84 (non-A) as it's older than dirt.....and they'll call it a 'feature'.
I didn't take it apart.
I turned it on.

The only stupid question is, well, most of them...

Save a fuse...Blow an electrician.
 
The following users thanked this post: neko efecktz

Offline neko efecktzTopic starter

  • Regular Contributor
  • *
  • Posts: 153
  • Country: au
Re: trouble with 2 x 16 ldr and pic
« Reply #3 on: May 21, 2016, 10:40:09 am »
the chip is Pic16F84 no A
I forgot to ask in my post how do I link Isis Proteus to mplab
would you know?

I tried changing the chip to PIC16F84A but still no better.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf