Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help "Pic-Agoras" Wheel speedo, asm file

Status
Not open for further replies.

Neil.r

New Member
Hi, Want to build a speedo for a model loco, fould Pic-Agoras, in Everyday Practical Etectronic April 1997, designed by John Becker
This looks just want I want, wityh a few mod's, as it can work with various wheel sizes, does speed in mph & kph, does distance.
I got the original articals from EPE, and the asm file.
The asm file, is writen in TASM, which I have been able to convert back to normal ASM, as I am using Microchips MPLAB v8.
It was using a 16C84, I want to use 16F628, I have converted it, I think.
"Bike440asm.txt", is the orginal file I downloaded
"Bike4_extra.asm", is what I have done so far, for a 16F628.

I have build the circuit on a breadboard, but can not get the LCD initisise, I have confirmed the circuit works with another fiel just to drive the LCD, I have tried to also run the origanal on a 16F84a, but still can not get it to work.

I am very much a novice on PIC's so, it could be something very simple.

I can not understand how this file does set up the LCD, as it is very different to the ones I have tried, ie, Nigel's tutorials on winpicprog.co.uk.

Hope someone can help

Neil, UK
 

Attachments

  • Bike440 asm.txt
    40 KB · Views: 184
  • Bike4_extra.asm
    33.8 KB · Views: 156
The configuration word needs to be setup for the 'f628, there are more bits to take care of.
In the init section of the 'c84 file you need to load 0x07 into the cmcon register, otherwise some of the pins on porta will be assigned to the comparator.
The start address for the file registers needs to be changed from 0x0c to 0x20 for the 'f628 (allthough if not many registers are being used this might not be necesasary).
Dont think theres anything else different.
 
Original artical

Attached is the original articals.
My thought is to replace the whole mag sensor (X1, IC1, IC2, etc) with a hall effect direct into RB0 (pin 6 on the PIC).
Also remove all the programming stuff, (S2, S3, S5, R6, R16, R17, R9, D2).

so
signal into RB0
RB1 to RB4 drive LCD D4 to D7, so 4 bit
RB5 to LCD RS
RB6 to LCD E
the mode select is RB7 to RA0, RA1, RA2, RA3, on a digital (Bin) switch.
 

Attachments

  • picagoras_0497-1.pdf
    9.4 MB · Views: 216
  • picagoras_0597-2.pdf
    3.7 MB · Views: 193
Hi,

Took the original file and ran it though mplab as a 16F84A chip modifying the tasm as needed.

As you found it does not display, but the simulation I ran shows that its not recognizing the interrupt signal on RB0, just running around that bit of code.

As John admits himself its a complex routine so might take a lot of time and trouble to debug fully.
Even then to modify his code to add in different things will probably be even more complex.

Perhaps with all his general methods shown in the pdfs it might be quicker for you to write your own from scratch; at least you will have 100% knowledge of whats happening.

Would also suggest you move onto the 16F88 ; many folk seem to have weird problems with the 628 chip as this forum shows.

good luck
 

Attachments

  • 2013-02-08 16_59_59-billyboy - MPLAB IDE v8.89.jpg
    2013-02-08 16_59_59-billyboy - MPLAB IDE v8.89.jpg
    81.7 KB · Views: 192
  • bike_84A.asm
    39.2 KB · Views: 145
Thanks Wp100,
At least you have confirmed it does not initialise properly. (I was worrying it was me!), Although I have done a few of Nigel's tutorials, and a few simple LED's, this is my first real project.
I have only tried the MPLAB simulator, and did not really understand what it was doing, I guess because it is so slow going through the code. is there any simulator you would recommend.
I have got an LCD asm file, to run this LCD as a stand alone on a 628, so I guess I can take some of Johns code and thougths.
I have never used interupts, so will need to learn this first I guess.

I have never thought about the 16F88, so will have to look at this as well.

Neil
 
I have never used interupts, so will need to learn this first I guess.

If you like to learn the basics, just program one micro with the crudest possible mainloop going on and on.

Add to it, the sensing and detection of a pushbutton pressed down.

Program an interrupt to flash a LED when you push that button.

The goal is to learn how to enter and HOW TO LEAVE the ISR. Once done, go for your current problem.

I escaped from interrupts for long time. Once I did as above things were MUCH simpler.

Buena suerte.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top