Show Posts
Pages: [1] 2 3 ... 23
1  Community / Exhibition / Gallery / Re: Arduino/Atmel development Board with LCD serial output on: September 06, 2013, 11:07:49 am
Nope not planning to use the second 328 for anything other then to just listen to the first 328  and print out what it says...it only for debugging purposes ..since I use atmel studio not the arduino ide getting a serial output window is harder so I just made this for that purpose.

Plastic dip is made by the same people who make liquid electrical tape...they just call the two products by a different name but for the most part its identical. A rubber non conductive and removable coating.
Yeah it was 6 dollars at homedepot
2  Community / Bar Sport / what the hell is a computer chip? .rant on: September 06, 2013, 11:03:42 am
I was reading an article about a business card that has a "computer chip" to let you access certain areas of a city.

The media uses this term a lot but what the hell is a computer chip?
If the chip is inside the card was it pulled out of a computer and then placed there? Because the card is not a computer so how is it a computer chip?

Is a computer chip a microcontroller? Then why not just say so.
If its just an RFID that's not even a microcontroller ...


Is a computer chip a CPU?

Such a vague term if you ask me.

If I rip an etc off a mother board and use it is that considered a computer chip??

Or is just any IC considered a computer chip?
So a resistor array alone is a pretty useless computer chip
3  Community / Exhibition / Gallery / Arduino/Atmel development Board with LCD serial output on: September 04, 2013, 03:23:11 am
basically just a simple board with an lcd for serial output being driving by a separate chip so that the chip im programming is not deprived of GPIO pins.
i wanted to make it all from scratch and use all my own code, even to drive the lcd, no libraries .
i learned a lot after making this, well i learned a lot of things not to do.
not the prettiest thing in the world but it get the job done.

Looking forward to progressing with the design and making it better and definitely cleaning it up.

i do not know how to embed youtube videos

http://youtu.be/4fbCXM3fYZo
4  Using Arduino / General Electronics / dont understand this relay, 120Vac / 12Vdc on: September 01, 2013, 09:17:24 pm
i know its probably simple
but i went out and got this relay at radioShack and according to the writing on the relay i should be able to switch my mains ac
with at least 12v @30ma

i just do not know what goes connected to what  as far as where the one of the AC lines will be and where the microcontroller conection will be , and i do know that   i need to use a few other components so that i do not toast my microcontroller.

basically lets say if i want to control a regular lamp plugged into the wall ,
i would splice of the lines from the cord and connect on end to one contact on the relay and the other end of the splice the a different contact
thus when the coil is active the two spliced ends will be connected inside the relay

since i need 12v to turn the relay on, and another lower voltage to run my arduino ,
i will probably  just using that same line and step down the mains to 12v via transformer and bridge rectifier , maybe more then 12c since the diodes will drop it a bit , and use that for the relay

then a voltage divider or a goood old voltage regulator to power the arduino.

but right now i just would like some insight on how this relay gets hooked up

so sorry the images come out like that, they look right side up on my phone


5  Using Arduino / Programming Questions / why DOES this code work.. on: August 29, 2013, 10:56:39 pm
Code:
void sendString ( char *myString)
{
while (*myString> 0)
{
sendChar(*myString++);

}
}

when i send a string it displays it properly, but if i increment my string pointer from the get go it never sees index 0 which would be the first letter yet it does in fact display it ;
how so? is there a null character in beginning of my string?

the way i see is it like any array
"EDDIE"
0 1 2 3 4
E D D I E    <--see the E in the 0 position
but the very first operation in the while loop is *pointer++  so right there it goes to position one which is the first D...

im lost here smiley-sad
6  Using Arduino / General Electronics / Re: USBTiny and MK2 burned out when using ISP on: August 26, 2013, 07:29:17 pm
there is no other side , its a single sided layout , the rest of the layout if thats what your asking for is just another 328p set up with a zif socket ,
being that the entire board works flawlessly and my hex files upload just fine  i am beginning to think it indeed has to do with the grounds , i will try the
battery approach as stated ,
or perhaps power the board via the PC's USB while programming that way there will not be a grounding issue.

7  Using Arduino / General Electronics / USBTiny and MK2 burned out when using ISP on: August 25, 2013, 07:49:46 pm
okay so imade a little dev board
it has a 328p driving an lcd
and another zif socket to program a separate 328p

Ive been using it just fine and it uploads my hex files just fine
but last night it burned my only two programmers

I wonder perhaps my understanding of how to wire ISP is wrong?

I assumed the VCC pin of an ISP header goes to the same source that the 328p is getting power from, or does it go to the Power Pin of the uC?

i have provided the image of the board layout, sorry no schematic.

Normally my usbTIny is able to power up the uC , but the MK2 always give me an error and says the device voltage is not where it needs to be so it obviously doesnt power the uC so i have to power it up form another source
with of  course common grounds.

an input voltage of 9v is being applied to 7805
and from there i power the chip


and the port that the isp is on is not being used for anything, only portc to drive the lcd

its weird because you figure if something was wrong it wouldnt upload my hex files , but it did,
perhaps leaving the  isp header connected while turning on the board fried my USBTINY
but why did it fry the MK2 if it REQUIRES the chip to be externally power since it does not give it juice.
 

 I would really appreciate some insight since i plan to get more programmers now and keep using the board
or make another one but if my understanding of how to route the ISP is wrong then this will become a rather expensive lesson to learn



 
8  Using Arduino / Programming Questions / silly me!! need lcd help on: August 14, 2013, 10:06:14 pm
well i went ahead and made a pcb and soldered an lcd , 16x2 , to it so basically all the wiring is set in stone
and lately ive been wanting to learn how to do things without using other peoples libraries just so that i may learn how things really work behind the curtains

okay like i said my wiring is set in stone so keep that in mind...

unfortunately  i never used an lcd before so i just counted how many connections i needed and stuck them all over the microcontroller

the wiring is:

Enable :                PINC5
ReadWrite :          PIND2
RegisterSelect       PIND3

DataLines 4 - 7      PortC Pins 4 - 1

and a pot from ground to 5v and wiper to the contrast pin

Code:
/*
* DevBoardLCD.c
*
* Created: 8/12/2013 2:31:39 AM
*  Author: eddiea6987
*/

#define F_CPU 16000000
#include <avr/io.h>
#include <util/delay.h>

#define enable PINC5 //when writting to lcd data is transfered only on the high to low transition
#define readWrite PIND2 //read write :low to write commands or high to read
#define registerSelect PIND3 //register select : low = commands : high = character

//PORTC    0 0 0 [ 0 0 0 0 ] 0
//the above shows my data lines on port c
void flipEnable(void);
void portCReset();
int main(void)
{


DDRD |= (1<<registerSelect | 1<<readWrite) ; //set controls to output since i will only be writing to them
DDRC = 0b11111111; //set all of port c to out put since its my data lines and enable pin

PORTC &= ~(1<<enable); //set enable low
PORTD &= ~(1<<readWrite | 1<<registerSelect); //set readwrite to low to write to lcd , and set register select to low to send command
_delay_ms(2000);//delay to let lcd  stabalize..probably too long of a delay but its ok




//send 3 commands of 0x30 to let the lcd start up properly in 8 bit mode  /////////
//0b00110000
portCReset(); //make sure all ports on c are cleared


//PORTC    0 0 0 [ 0 0 1 1 ] 0
PORTC |= (1<<PINC1 | 1<<PINC2);//since my data lines dont correspond exactly to the 4 lower pins on port c, but rather pins 4-1  this is how i have to do it
//equivilant of 0x30
flipEnable();


PORTC |= (1<<PINC2 | 1<<PINC1);  // do it again
flipEnable();



PORTC |= 1<<PINC2 | 1<<PINC1 ; //and one more time
flipEnable();


//PORTC    0 0 0 [ 1 0 0 0 ] 0      now set to 4 bit mode, these are the high bits of the byte
PORTC |= 1<<PINC2 ;
flipEnable();

//PORTC    0 0 0 [ 1 0 0 0 ] 0
PORTC |= 1<<PINC4 | 1<<PINC3; //send command 1100 to set to two line mode and to enable display , these are the 4 lower bits
flipEnable();
_delay_ms(2); // should be in 4 bit mode now...theoretiaclly




while(1)
{

//test A
PORTD |= 1<<registerSelect; // set register select high to send character
        portCReset(); // let me clear the data lines just to be safe


//let me send capital "P" 01010000
// so the 4 high bits are 0101
//which on my ports c would be PORTC    0 0 0 [ 0 1 0 1 ] 0
PORTC |= 1<<PINC1 | 1<<PINC3 ;
flipEnable();

    portCReset(); // since this clears the port , the data lines are now low and i can send the 4 lower bits which are 0's anyways
flipEnable();
_delay_ms(5000); //just delaying to see if anything happens
// i get all black boxes on on the top line , which i read somewhere it means it is not initialized..

}

}
void portCReset()
{
PORTC = 0B00000000;


}
void flipEnable()
{
PORTC |= (1<<enable);//toggle the enable pin so that data can be transfgered on falling edge
_delay_ms(5);
PORTC &= ~(1<<enable);
_delay_ms(5);
portCReset(); // reset the data lines

}

9  Community / Bar Sport / was reading this article but... on: August 14, 2013, 05:37:04 pm
Here the article http://secureidnews.com/news-item/contact-contactless-or-flesh/

what i dont understand is how can the human be the medium by standing on a pad to get "charged" up
wouldnt you have to be barefoot?
10  Using Arduino / Programming Questions / need 4 high bits in 4 ports pins on: August 13, 2013, 09:11:10 pm
i need the 4 high bits of a binary number to set 4 pins on portc , not the four high bits of the port , meaning the four pins i need set are split between the 4 high and four low pins
example
binary 8 bit 
extract 4 high bits :    testNUmber<<4
PORTC                       7 6 5 4 3 2 1 0
testNUmber                x x x 1 1 1 1 x
                                         
these 4 bits need to set or clear these 4 pins
bitwise operations always make me run in circles

would i do something like
PORTC =0b00011110 | (testNUmber<<4);

??

I cant really test it out right now if not i would run some tests  but im not home.
11  Using Arduino / Project Guidance / Re: Reason for not using resistor to LED on: August 09, 2013, 11:52:58 pm
there should be.. who said no?
12  Using Arduino / Programming Questions / Memory and unused functions in a library on: August 09, 2013, 11:38:16 pm
well not exactly a library just another c file and header file , ive yet to learn about libraries and linking so for now i am only writing things in separate c and h files
but i wonder if i write a generic c file with multiple functions for doing a lot of tasks but  i only use some of them in my main c file do the unused ones take up memory?


 
13  Using Arduino / Programming Questions / Re: What happens before the loop function? on: August 09, 2013, 10:55:45 pm
if you take away the code in the setup part  of the fade sketch it will still work ,
try getting a book for beginners in arduino it will really help you understand some very basic things like this
14  Using Arduino / Programming Questions / Re: 8bit variable and struct to represent a Register & its bits on: August 09, 2013, 10:15:11 pm
interesting i totally forgot about this
a quick sizeof showed me  i went from 16 bytes to one bite on the size of the structure , how nice


15  Using Arduino / Programming Questions / Re: 8bit variable and struct to represent a Register & its bits on: August 09, 2013, 10:08:06 pm
i just tried it and seems to work
the names bitZero - bitSeven would be changed to match the register bits such as MUX1 , MUX2, obviously i would have to change it since it cant literally match
and the structure name would be changed to something like ADCsetup ..
 
now it would be ideal if i could initialize the fields to zero so i do not have to set each field to zero , but since this will be a generic reusable file for my self
ill have a function to initialize them all to zero
that way i only set the fields i am interested in


Code:
struct testReg
{
  int bitZero ;
  int bitOne ;
  int bitTwo ;
  int bitThree;
  int bitFour;
  int bitFive;
  int bitSix;
  int bitSeven;
 
 
 
};

struct  testReg  regEdit ; //structure that will represent a register and its settings

uint8_t myVar = 0;
void setup()
{
   Serial.begin(9600);
  DDRB |= 1<<PINB5 ;
   
 
}

int doTheMath()
// check each field of the structure and weather its true or false add that bit value to the uint8_t
{
    regEdit.bitZero < 1 ? myVar = 0 : myVar = 1 ;
   regEdit.bitOne < 1 ? myVar = myVar : myVar +=2 ;
   regEdit.bitTwo < 1 ? myVar = myVar : myVar +=4 ;
   regEdit.bitThree < 1 ? myVar = myVar : myVar +=8 ;
   regEdit.bitFour < 1 ? myVar = myVar : myVar +=16 ;
   regEdit.bitFive < 1 ? myVar = myVar : myVar +=32 ;
   regEdit.bitSix < 1 ? myVar = myVar : myVar +=64 ;
   regEdit.bitSeven < 1 ? myVar = myVar : myVar +=128 ;
  return myVar;
}

void loop ()
{
 
   regEdit.bitZero = false ;
   regEdit.bitOne = false ;
   regEdit.bitTwo =false  ;
   regEdit.bitThree = false;
   regEdit.bitFour = false;
   //ive set only the 5th bit to true  , which i will pass to port B where bit 5 is the led on digital pin 13
   regEdit.bitFive = true ;
   regEdit.bitSix = false ;
   regEdit.bitSeven = false;
   
   PORTB ^= doTheMath();
   Serial.println(doTheMath());
   delay(50);
   
}
Pages: [1] 2 3 ... 23