AOA Forums AOA Forums AOA Forums Folding For Team 45 AOA Files Home Front Page Become an AOA Subscriber! UserCP Calendar Memberlist FAQ Search Forum Home


Go Back   AOA Forums > Hardware > Hardware Hacking

Hardware Hacking The hammer and tongs school of Overclocking. (NOT for the beginner and you assume all risks)


Reply
 
LinkBack Thread Tools Rate Thread
  #1 (permalink)  
Old 25th January, 2010, 06:51 PM
Chief Systems Administrator
 
Join Date: September 2001
Location: Europe
Posts: 13,075

MPLAB SIM and Alternate pin function!?

I'm throwing this out to see if anyone else can make sense of this...

Some background: I'm "playing" around with a PIC 12F615 microcontroller. Ultimately, if I can make it do what I want it to do, it'll control a remote control toy. I've written a fair bit of code that works in a simulator. Except for one small part. As the "user interface" of the device is actually an IR transmitter, I need to be able to receive IR pulses. The code I'm using is using one of the timers to time how long a pulse is, in order to determine if it's a zero or a one.

Due to the way the pins are set up, I need to use an alternate pin function for timer 1 gate (T1G). However, when I try this in the simulator (MPLAB SIM), it doesn't appear to work how I expect it to work. A small sample of code is below:

Code:
; Alt !T1G Testing
;
	#include <P12F615.INC>
	__CONFIG h'3CD4'
	org 0
Start:
; IO Port Setup
; T1G is GPIO4
	BANKSEL	ANSEL
	CLRF	ANSEL		; Digital I/O, ADC off.

; Timer1 gate setup
	; !T1G is normally GP4
	; Select alt !T1G - GP3 input
	BANKSEL	APFCON
	BSF		APFCON,T1GSEL

	BANKSEL	T1CON
	MOVLW	b'11000001'	; Gate active high and enabled, timer on
	MOVWF	T1CON		; Let's go!


	GOTO $ 				; And go...
END
Am I just stupid, or is something else going on here? All the software needed can be downloaded for free from this page: MPLAB Integrated Development Environment.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 26th January, 2010, 12:21 AM
Gizmo's Avatar
Chief BBS Administrator
BassTeroids Champion, Global Player Champion, Aim & Fire Champion, Puzzle Maniax Champion, Othello Champion, Canyon Glider Champion, Unicycle Challenge Champion, YetiSports 9: Final Spit Champion, Zed Champion
 
Join Date: May 2003
Location: Webb City, Mo
Posts: 16,178
Send a message via ICQ to Gizmo Send a message via AIM to Gizmo Send a message via MSN to Gizmo Send a message via Yahoo to Gizmo Send a message via Skype™ to Gizmo

Perhaps this is one of those corner-cases where the hardware behaves slightly different than the emulator?

Too bad they chose to write their own IDE (that is windows-only) rather than a plugin to Eclipse.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 26th January, 2010, 10:46 AM
Chief Systems Administrator
 
Join Date: September 2001
Location: Europe
Posts: 13,075

I'm presuming that it must be bug in the SIM. Too bad, as I was hoping to test out my IR reception code to ensure it works as designed! I didn't want to have build a test rig to check things out, but I guess I will have to do so!
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 26th January, 2010, 07:09 PM
Chief Systems Administrator
 
Join Date: September 2001
Location: Europe
Posts: 13,075

The Linux simulators haven't yet caught up with the devices I'm using, but MPLab does run fairly well under wine. As far as MPLAB goes, the majority of their software can be called from the command line, but not the simulator.
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Alternate pixel center disable NFS Porsche Unleashed trodas Graphics and Sound cards; Speakers and other Peripherals 3 27th February, 2009 05:09 PM
Win XP Repair Function Dsherm112 CRASHED! 1 20th February, 2006 01:27 AM
An alternate to 8RDA+????? Bucks AMD Motherboards & CPUs 6 4th January, 2003 02:26 AM
Function Driver? dod CRASHED! 3 10th November, 2002 03:55 PM
search function Holst Forum Feedback and Suggestion Box 6 24th February, 2002 03:38 AM


All times are GMT +1. The time now is 08:33 AM.


Copyright ©2001 - 2010, AOA Forums
Don't Click Here Don't Click Here Either

Search Engine Friendly URLs by vBSEO 3.3.0