Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Code migration from 16C774 to 18F4423

Status
Not open for further replies.

itisme

Newbie level 4
Joined
Mar 20, 2009
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,330
Hello,
I have working code for 16C774 written in Assembler. Microchip recommend switch to 18F4423 so I'm thinking about code translation. Is there any automatic tools available? Maybe some guides? Would appreciate for any help.
Thanks and best regards!
 

Hi,

I used to code with 16Fs in assembley and the conversion to 18F is not that hard, very little needs changing, though the amount of work depends on the size of your code and if it has plenty of helpful notation.

If its just a list of code converted from the chips .hex file give up now.

It it a genuine assembly listing, post the code in a zip or rar file and lets have a look.
 

Hi wp100,
Attached please find assembly listing ...
I'll appreciate for your help.
yb.
 

Attachments

  • PIC16C774_src.zip
    7.9 KB · Views: 42

Hi,

Just had a quick look at the code, clearly not yours.


Before its worth looking at futher need to know some things.

The frequency of the crystal used in the circuit.

Do you have this program running on an exsiting circuit or simulator ? or are you trying to convert it to a 18F to allow you to build it ?

Can you post the circuit diagram or any other links on the project.

PM me the details if you so not want to put them on the open forum.
 

Hi,
Code is not mine, you are right, I just planning to base my project on this. Here is a link: **broken link removed**
All open, no secrets at all :)
Thank you for helping ...
 

Hi,

Yes, had just found that page.

You seem to have missed the point that the code will run on the Pic16F877A chip with little modification; its a chip thats readily available and lo cost.

The only difference is that the adc result is 10 bits instead of 12 bit.

Do not know what you are wanting to read in to the adc ports ?

Is it just a learning experiment or a project to meet some specific needs.

Also are you wanting to learn assembler programming or just use it for this one project ?

Just helps me give you better direction. ie the project shown is quiet complicated and not the best example for someone just starting in assembly.


The pic below show the code built using the 16F877A chip which just has a couple of differences to sort out; a Lot easier than converting to a 18F chip.
 

Attachments

  • 2012-12-22 14_34_51-billyboy - MPLAB IDE v8.80 - [Output].jpg
    2012-12-22 14_34_51-billyboy - MPLAB IDE v8.80 - [Output].jpg
    97.4 KB · Views: 58

Hi,
Yes, 12 bits ADC is must. Actually I need monitor one analog signal at 8...10 kHz rate and have one digital output in order to enable/disable motor. I'm also planning to use FT232 for USB.
As for learning/experimenting - that is out of scope, for building DAQ only.
 

Hi,

Not sure I know what you are trying to do there.

Are you saying if the frequency of the signal changes it turns off a motor or if the amplitude of the signal changes ?

Easier if you say exactly what the input device is, and if its signal is passed though any form of amplifer etc ?
 

Input device is pressure sensor. Signal is scaled by amplifier. I will need enable digital output, record couple of seconds the analog input then disable output. All future signal processing will be done on PC by software.
 

Input device is pressure sensor. Signal is scaled by amplifier. I will need enable digital output, record couple of seconds the analog input then disable output. All future signal processing will be done on PC by software.

Hi,

Well for your needs it seems a long haul to convert that program to the 18f code, am sure there are lot of simpler adc projects out there or on this forum.


However afraid I still do not understand where the 10K frequency comes from ?


I am not familiar with pressure sensors, but just looking at several in the Farnells catalgue most just seem to have a simple voltage output, some being quiet low, needing a voltage amplier to raise the 50mv to 5v ; many having 5v outpts already and some even incorperating an adc unit so it can feed a digital signal direct to the Pic.
https://uk.farnell.com/freescale-semiconductor/mpl115a1/barometer-digital-50-115kpa-spi/dp/2238137

Perhaps you are using some other type of sensor that does produce a frequency output ?

Be better if you state the exact sensor /datasheet.
 

Hi,
Sensor produce continues analog signal proportional to the pressure. 10 kHz is sampling rate which I need, i.e. resulting file will contain one A/D record each 0.1 mSec.
Actually what I'm looking for is ability to record (on PC) analog signal with ~10 kHz sample rate and control one digital output via PC. Since RS232 can be problematic for such data rates (10,000 of 12 bit records/Sec) I'm planning to design USB interface.
 

Hi,
Sensor produce continues analog signal proportional to the pressure. 10 kHz is sampling rate which I need, i.e. resulting file will contain one A/D record each 0.1 mSec.
Actually what I'm looking for is ability to record (on PC) analog signal with ~10 kHz sample rate and control one digital output via PC. Since RS232 can be problematic for such data rates (10,000 of 12 bit records/Sec) I'm planning to design USB interface.

Hi,

You are now a long way from talking about converting some program code.

What you re looking to do is quiet possible, but you originally said you just wanted to do this -
As for learning/experimenting - that is out of scope, for building DAQ only.
but it now sounds like you are doing a full project ?

If so you need to gain a better knowledge and understanding of how pic operate.

USB can be achieved by using a printer cable adapter via the Pics serial port with assembly, but true USB requires a USB enabled pic chip and the use of Microchips C suite and USB firmware - a major project in its self.

ADC at 10k is possible but you need the hardware and software setting up accordingly.
Have a look here https://www.edaboard.com/threads/175050/

Would have to question who could make use of 10,000 pressure sensor readings per second. if thats what you really need ?
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top