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
 
Tools
Old 26th June 2008, 12:20 PM   #16
Default

Refresh Rate = 1 / (column1period + column2period + column3period + column4period + column5period)

Last edited by Mike, K8LH; 26th June 2008 at 12:21 PM.
Mike, K8LH is offline  
Old 26th June 2008, 12:49 PM   #17
Default

Quote:
Originally Posted by futz View Post
Kewl, huh? And C code is very very portable from PIC to PIC. I wrote code for 16F88 and with only minor changes ran it on 18F248.
Slightly off topic but...

I've been following your progress on the Clock/Calendar/Thermometer project (with Predko 2-pin 74LS174 LCD interface) and I suspected that you didn't have to change much code when porting from the 16F88 to the 18F248. Very nice project and writeup btw (as always)...

Would you consider testing my DayOfWeek routine now that you have calendar capability?

Mike

Code:
unsigned char Month = 6;         // 1..12
unsigned char Day = 18;          // 1..31
unsigned char Year = 08;         // 0..99 (2000-2099)

//  71 instructions on 12F683 (BootsC 16)

unsigned char DayOfWeek()        // Mike McLaren, K8LH, Aug '07
{                                // returns 0..6 (Sun..Sat)
  unsigned char Leap = 0;
  const char Base [] = { 5, 1, 1, 4, 6, 2, 4, 0, 3, 5, 1, 3 };

  Leap = (Year & 3) || (Month > 2);
  return (Base[Month-1] + Day + Leap + Year + Year/4) % 7;
}

Last edited by Mike, K8LH; 26th June 2008 at 12:55 PM.
Mike, K8LH is offline  
Old 26th June 2008, 02:36 PM   #18
Default

Mike,

I can confirm your algorithm works correctly until 1st March 2100.

I wrote a little excel sheet to confirm it.

Mike.
Pommie is online now  
Old 27th June 2008, 04:38 AM   #19
Default

I breadboarded Mike's creation, going by the schematic he provided. Holy hell!!! That's a lot of wires to squeeze onto a little breadboard! As you can see, I gave up keeping it neat after a while. Just too many...
BoostC Charlieplexed PWM 32-mike_led002_800x600.jpg
The switches switch GP0 and GP1 between programming mode and run mode.

But it doesn't work!! Some LEDs light, but no action.

Mike! How accurate is that schematic? It doesn't say the resistor values, so I did some educated guessing.
__________________
=========================
Futz's Microcontrollers & Robotics
=========================
futz is offline  
Old 27th June 2008, 04:47 AM   #20
Default

Sorry you're having problems.

Transistors are 2N3904 NPN. Most people see that they're sourcing drivers and assume they're PNP (because the drawing is so fuzzy).

I originally used 510 ohm base resistors and 20 ohm current limiting resistors on the rows but the board in the picture has been taken apart so many times that there are NO resistors at all at the moment. Bad practice I know. It just shows how forgiving this stuff is...

Let me know how it goes?

Mike

Last edited by Mike, K8LH; 27th June 2008 at 04:50 AM.
Mike, K8LH is offline  
Old 27th June 2008, 04:52 AM   #21
Default

Quote:
Originally Posted by Mike, K8LH View Post
Transistors are 2N3904 NPN. Most people see that they're sourcing drivers and assume they're PNP (because the drawing is so fuzzy).
I used 2N2222A's with 1.2K base resistors.

Quote:
and 20 ohm current limiting resistors on the rows
I've got 330's on the rows. Too much, but they were there and I wanted to start out safe.

Guess I'll go over the whole thing and trace every wire again. Sigh...
__________________
=========================
Futz's Microcontrollers & Robotics
=========================
futz is offline  
Old 27th June 2008, 05:28 AM   #22
Default

Wrote some test code and I have something happening. LED's are flashing, but not quite properly under my control yet. It's not dead. I just haven't figured out what the problem is yet.
__________________
=========================
Futz's Microcontrollers & Robotics
=========================
futz is offline  
Old 27th June 2008, 05:57 AM   #23
Default

I don't see a bypass cap' across VDD and VSS pins in that photo'.

Last edited by Mike, K8LH; 27th June 2008 at 06:00 AM.
Mike, K8LH is offline  
Old 27th June 2008, 05:59 AM   #24
Default

Nice design Sir ...I like it very much....

May I hack your hardware design? but not the code

Also can you show the underneath of your board Sir if you don't mind?
__________________
Gayan

My Website
http://gsmicro.blogspot.com/
Gayan Soyza is offline  
Old 27th June 2008, 06:07 AM   #25
Default

Quote:
Originally Posted by Mike, K8LH View Post
I don't see a bypass cap' across VDD and VSS pins in that photo'.
Nag, nag, nag! OK, OK! I'll put one on there!

I have it working as expected with my code. Wonder if it's my current limiting resistor values that's making yours not appear to work?
__________________
=========================
Futz's Microcontrollers & Robotics
=========================

Last edited by futz; 27th June 2008 at 06:08 AM.
futz is offline  
Old 27th June 2008, 06:23 AM   #26
Default

A YouTube video of the test code at work.
__________________
=========================
Futz's Microcontrollers & Robotics
=========================
futz is offline  
Old 27th June 2008, 06:33 AM   #27
Default

Futz nice video

I like to compact my real Knight Rider Running Lights project with a compact matrix arrangement on a 8 pin PIC.

I like to do the hardware like Mike did.Anyway I need his rights.
__________________
Gayan

My Website
http://gsmicro.blogspot.com/
Gayan Soyza is offline  
Old 27th June 2008, 01:28 PM   #28
Default

Quote:
Originally Posted by Gayan Soyza View Post
Nice design Sir ...I like it very much....

May I hack your hardware design? but not the code

Also can you show the underneath of your board Sir if you don't mind?
Hi Gayan,

I'm not sure what you mean by "hack my design".

Attached is picture of bottom of board. It contains one surface mount PNP row driver transistor on GP0 (an experiment to increase peak current from 20 ma to around 50 ma).

Mike
Attached Thumbnails
BoostC Charlieplexed PWM 32-pwm-20-pcb-bottom.png   BoostC Charlieplexed PWM 32-pwm-20-v2-schem.png  
Mike, K8LH is offline  
Old 27th June 2008, 01:37 PM   #29
Default

Quote:
Originally Posted by futz View Post
A YouTube video of the test code at work.
Looks very nice. Did you say my program doesn't work? RGBPhil is using it for his "Cylon Eye"...

Mike

Mike, K8LH is offline  
Old 27th June 2008, 01:38 PM   #30
Default

Hi Mike,
Nice demo, what do you have planned for the practical usage of the plex.?

I expect it will be a slighter larger PIC, to enable an external input of some kind.

Regards
__________________
Eric " Good enough is Perfect "
I will NOT answer PM's requesting technical help, please use the Forum
PIC tutorials: Nigel's www.winpicprog.co.uk/ Bill's: www.blueroomelectronics.com/
ericgibbs is offline  
Reply

Tags
boostc, charlieplexed, pwm

Thread Tools
Display Modes


Similar
Title Starter Forum Replies Latest
BoostC question.. AddressOf Mike, K8LH Micro Controllers 8 25th June 2008 12:20 AM
LCD degree symbol with sprintf (BoostC) futz Micro Controllers 29 5th June 2008 05:19 AM
math.h and lib for BoostC? futz Micro Controllers 3 31st March 2008 06:29 AM
Charlieplexed code segment for the Cricket Thermostat William At MyBlueRoom Micro Controllers 2 14th March 2006 05:12 PM
My PIC Projects Site NEW (includes 2 Charlieplexed Display) William At MyBlueRoom Electronic Projects Design/Ideas/Reviews 0 28th February 2006 02:31 PM



All times are GMT. The time now is 05:39 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker