February 2011 Blog Posts (4)

RTC + PIC18 = <3

Here's my RTC sample code, ported for PIC18F4620. I added SSPIF support but disabled the interrupts and changed quite a bit of code in the basic I2C low-layer macros, including some #v()-literals to save space.

I wrote it in emacs, and have no clue how to use MPLAB. Sorry :)

Also note that it's relocatable code and full of my own debugging lines. You may have to play around with it to get it to work with your code. But it does definitely work the way it is…

Continue

Added by Sebastian Kosch on February 19, 2011 at 11:00pm — 1 Comment

ADC Sample Code has a bug (it seems)

There seems to be a mistake, because the code did not work, and after my change, it did work.

 

MainLoop

    bsf        ADCON0,2        ;start conversion and wait for it to complete

    btfsc    ADCON0,2

    goto    $-2

 

goto $-2 is wrong, because it goes back 2 lines and starts the conversion all over again. You'll want to goto $-1 instead, to just test until the conversion is done.

 

However, I would reccommend this…

Continue

Added by Ritchie Thai on February 19, 2011 at 7:21pm — No Comments

EEPROM Access

The information regarding the EEPROM is minimal in the manual and you will need to go into the datasheets to get a bigger picture (as is the case for pretty much everything). This post is just to add to the stuff the manual is missing, so that you do not have to go searching through the datasheet.

 

First off, the datasheet itself uses VALUE and ADDR as registers to contain the data it would like to store. If you implement the code as is, it will not work. You will need to…

Continue

Added by Alim Jiwan on February 6, 2011 at 1:41am — No Comments

Tool: MPASM LCD String Writing Code Generator

http://dozydagger.com/misc/mpasm-lcd-writer.html

 

You know what I say to tables? Well, I don't say it, because I am not the type to publicly use such language, but once you get past the character limit it causes problems that can be tricky even if the solution is known.

 

Here's a work around that I'm using. "can" wasn't worth making a table for. A table would take 4 lines. If you include the code to…

Continue

Added by Ritchie Thai on February 1, 2011 at 1:30am — No Comments

Monthly Archives

2024

2023

2018

2016

2015

2014

2013

2012

2011

2010

2009

1999

1991

1990

1989

1988

1987

1986

1985

1984

1983

1982

1981

1980

1979

1978

1977

1976

1975

1974

1973

1972

1971

1970

1969

1968

1967

1966

1965

© 2024   Created by PML.   Powered by

Badges  |  Report an Issue  |  Terms of Service