Other Programming Languages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreOther Programming Languages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 3rd, 2009, 01:34 AM
laguna92651 laguna92651 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2008
Posts: 9 laguna92651 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 41 m 15 sec
Reputation Power: 0
Assembly - 8 bit signed to LED's

I am starting to write a assembly program for a mc68hc12. I will be reading a 8 bit signed number into PortA and outputting the results to 7 segment LED's, common anode. I will be using Port P to ouput the segments and PortCan to control the LED's displayed. I assume I need 4 LED's, 1 for the sign and 3 LEDs for the max number of 128. If I hard wired the data in I get something like below. How would I go about pulling the data in from a port and then displaying the number on a set of LED's?

Code:
org $1000
        ldaa #$ff
        staa DDRP
        ldaa #$7c
        staa DDRCAN
forever ldy #display
next    ldaa 0,y
        staa PORTP
        ldaa PROTCAN
        anda #$83
        staa PROTCAN
        ldaa 1,y
        oraa PORTCAN
        staa PORTCAN

;a delay subroutine here to would cycle back to forever

display
       fcc  $30,$40
       fcc  $6d,$20
       fcc  $79,$10
       fcc  $33,$08
       fcc  $5b,$04


Thanks

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreOther Programming Languages > Assembly - 8 bit signed to LED's

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap