Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 8th May 2008, 11:15 AM   (permalink)
Experienced Member
Pommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to behold
Default

You are correct, I got the 9 and 5 the wrong way around. I'll edit it.

Mike.
Pommie is offline   Reply With Quote
Old 8th May 2008, 12:39 PM   (permalink)
New Member
skyhawk is a jewel in the roughskyhawk is a jewel in the rough
Default

Quote:
You are correct, I got the 9 and 5 the wrong way around. I'll edit it.
I believe that you should subtract 32 not add.

F -> C subtract 32, multiply by 5/9.
C -> F multiply by 9/5, add 32.

Of course, it's the student's responsibility to check, since it's their project and they will be getting the grade.

I was adjunct faculty in a chemical engineering department for several years. The first lecture in the first chemical engineering course taught to sophomores was unit conversions. I really hated to teach the problem session that went with that lecture - an hour and a half of unit conversion problems. How dry!

Anyway, it's a bit disheartening that a senior engineering student is asking for help on unit conversions.

Just my two cents!
skyhawk is offline   Reply With Quote
Old 8th May 2008, 01:07 PM   (permalink)
Experienced Member
Pommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to beholdPommie is a splendid one to behold
Default

Bugger, you are right again. I was thinking the freezing point of water was -32°F. It's that long since I worked in such archaic units I got confused.

Mike.
Pommie is offline   Reply With Quote
Old 9th May 2008, 05:13 AM   (permalink)
New Member
engineergirl27 is on a distinguished road
Default

You guys are great, I have never been so greatful that my project, would bring so much conversation I am currently debugging this code right now if you want to see it. I am rather proud of it since I am an amature and I was told that May 9th would be tough to get it working by. It is is almost working.

Elizabeth
Attached Files
File Type: asm FixedAtoDwithother4.ASM (8.0 KB, 8 views)
engineergirl27 is offline   Reply With Quote
Old 9th May 2008, 05:15 AM   (permalink)
New Member
engineergirl27 is on a distinguished road
Default

my code went from like 130 lines to about 4 hundred with about 2 hours of work, using source code and testing. I think i am finally getting this stuff
engineergirl27 is offline   Reply With Quote
Old 9th May 2008, 05:28 AM   (permalink)
New Member
engineergirl27 is on a distinguished road
Default

Quote:
Originally Posted by skyhawk

Anyway, it's a bit disheartening that a senior engineering student is asking for help on unit conversions.

Just my two cents!
I am not asking about the actual unit conversions just about coding to go with that sorry I didn't make myself clear for you. But I don't appreciate you assuming that I don't know unit conversions. Yes I am inexperienced in code but I have pretty much carried my whole senior design project.

Elizabeth
engineergirl27 is offline   Reply With Quote
Old 9th May 2008, 08:38 AM   (permalink)
Experienced Member
 
ericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to beholdericgibbs is a splendid one to behold
Default

hi Elizabeth,
Ran your program in simulation.
The Interrupt [ISR] needs to be corrected also the related Interrupt Enables.
After the first ADC read, the program keeps looping in the Call CelConversion routines.?

You are using TMR0 as an Intr.

extract from microchip 16F877A template
NOTE the ISR origin.


;************************************************* *********************
Code:
	ORG     0x000             ; processor reset vector

	nop			  ; nop required for icd
  	goto    main              ; go to beginning of program


	ORG     0x004             ; interrupt vector location

	movwf   w_temp            ; save off current W register contents
	movf	STATUS,w          ; move status register into W register
	movwf	status_temp       ; save off contents of STATUS register
	movf	PCLATH,w	  ; move pclath register into w register
	movwf	pclath_temp	  ; save off contents of PCLATH register

; isr code can go here or be located as a call subroutine elsewhere

	movf	pclath_temp,w	  ; retrieve copy of PCLATH register
	movwf	PCLATH		  ; restore pre-isr PCLATH register contents
	movf    status_temp,w     ; retrieve copy of STATUS register
	movwf	STATUS            ; restore pre-isr STATUS register contents
	swapf   w_temp,f
	swapf   w_temp,w          ; restore pre-isr W register contents
	retfie                    ; return from interrupt



main
; remaining code goes here
;---------------------------------------------------------------------------

Do you follow.?
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/

Last edited by ericgibbs; 9th May 2008 at 08:41 AM.
ericgibbs is online now   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Uni Project Advice 2-tone Electronic Projects Design/Ideas/Reviews 7 18th October 2007 12:10 AM
My professor screwed my final electronics project! kungfusansu Electronic Projects Design/Ideas/Reviews 21 26th August 2007 09:57 PM
RPM Counter (Project Started PIC16F877A) Ayne Micro Controllers 28 2nd May 2007 01:52 PM
PIC16f877A Project help Alex Ng Micro Controllers 5 26th July 2006 07:47 AM
A Microcontroller based Analogue Waveforms Analyzer Project km Electronic Projects Design/Ideas/Reviews 76 30th June 2004 06:39 PM



All times are GMT. The time now is 05:50 PM.


Electronic Circuits  |  Radio Controlled
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.