Search found 175 matches

by cobra1
Tue Jan 28, 2014 4:43 pm
Forum: General Programming
Topic: Generate a 32.768khz signal
Replies: 5
Views: 3091

Generate a 32.768khz signal

Hi. What would be the best way to generate a 32.768khz signal using a PIC. Main crystal is 16Mhz. The signal needs to be a square wave with and amplitude of 3v. Im thinking something interrupt based toggling a output pin. I would prefer not to use additional crystals if i can help it. Would timer 2 ...
by cobra1
Sat Jan 25, 2014 9:33 pm
Forum: General Programming
Topic: 8bit vs 16bit microcontrollers
Replies: 1
Views: 2094

8bit vs 16bit microcontrollers

Hi, I have a question that I don't seem to be able to find a simple answer for. Imagine we have 2 PIC microcontrollers. 1 of these 8bit and the other 16bit. Both PICs running at the same frequency etc. Both PICs are sending data via SPI to a colour display. The 8bit microcontroller would send 2 byte...
by cobra1
Sat Jan 25, 2014 8:23 pm
Forum: Flowcode V6
Topic: ARM Microcontrollers
Replies: 2
Views: 961

Re: ARM Microcontrollers

I have just seen that atmel produce other SAM7 chips. In the device list we have for example an AT91SAM7S256, these are now discontinued. However they produce an AT91SAM7X256, These appear to be currently manufactured. Only difference is they have different pin counts, 64 and 100 respectively. Would...
by cobra1
Sat Jan 25, 2014 7:13 pm
Forum: Flowcode V6
Topic: ARM Microcontrollers
Replies: 2
Views: 961

ARM Microcontrollers

Hi, I was just looking through the chip list in V6 for ARM controllers as I may have a project that would be best suited to ARM due to its 32bit core. Unfortunately it would seem that almost all of them are no longer manufactured. from the list I found 2 that have decent levels of stock at farnell b...
by cobra1
Thu Jan 23, 2014 6:59 pm
Forum: General Programming
Topic: Calculating Powers using integer math ??
Replies: 6
Views: 3848

Re: Calculating Powers using integer math ??

Hi, I meant to do an example of how I did this but forgot about it. Here is the original equation, Temperature (°C) = Temperature Output Count /(2^14 - 1) x 165 - 40 Humidity (%RH) = Humidity Output Count / (2^14 - 1) x 100% In my case here I worked out what 2^14 equalled. in case your not sure how ...
by cobra1
Sat Nov 30, 2013 8:45 pm
Forum: Flowcode V6
Topic: Decision Question
Replies: 7
Views: 2762

Re: Decision Question

That looks good to me :)
by cobra1
Fri Nov 29, 2013 8:20 pm
Forum: Flowcode V6
Topic: Simple RS232 receiver
Replies: 3
Views: 1367

Re: Simple RS232 receiver

you could use an external falling edge interrupt on the incoming RX signal to detect the start bit and call the receive function. There will be no buffer using software mode so you will have to be calling the receive function or you will miss the data. If you know that you are sending a certain amou...
by cobra1
Thu Nov 28, 2013 7:51 pm
Forum: Flowcode V6
Topic: SSD1351 OLED Display Driver
Replies: 4
Views: 3548

Re: SSD1351 OLED Display Driver

Hi Ben, I tried the driver as you said and i cannot get it to work at all. Im not sure if the driver i linked in my first post used the D/C instruction Pin. I saw the driver you posted has a register select pin, i assume this is the same as D/C pin ??? Here is one that uses the D/C instruction Pin. ...
by cobra1
Thu Nov 28, 2013 1:56 pm
Forum: Flowcode V6
Topic: SSD1351 OLED Display Driver
Replies: 4
Views: 3548

Re: SSD1351 OLED Display Driver

Thanks for that Ben. I will try it when i get home this evening. I realised that the CS pin was wrong and did manage to get the screen to initialise and could plot pixels. I was getting a wierd problem tho. If i create a full white background and then put a pixel in another colour. That row of white...
by cobra1
Wed Nov 27, 2013 8:21 pm
Forum: Flowcode V6
Topic: SSD1351 OLED Display Driver
Replies: 4
Views: 3548

SSD1351 OLED Display Driver

I am trying to make a driver for a 128 x 128 OLED Display. It uses a SSD1351 Chipset and is driven using SPI. The datasheet for the Display is here. http://www.4dsystems.com.au/downloads/micro-OLED/OLED-128/Docs/Pdf/SSD1351-Revision%201.3.pdf I am using some code as a guide which can be found here. ...
by cobra1
Mon Nov 25, 2013 11:29 pm
Forum: General Programming
Topic: Calculating Powers using integer math ??
Replies: 6
Views: 3848

Re: Calculating Powers using integer math ??

I have figured this out now :)
by cobra1
Mon Nov 25, 2013 8:23 pm
Forum: General Programming
Topic: Calculating Powers using integer math ??
Replies: 6
Views: 3848

Calculating Powers using integer math ??

Hi, I am wondering if these formulas can be calculated using integer math, I have never worked with powers before so I have no idea how to proceed. Temperature (°C) = Temperature Output Count /(2^14 - 1) x 165 - 40 Humidity (%RH) = Humidity Output Count / (2^14 - 1) x 100% The formulas can be found ...
by cobra1
Sat Nov 23, 2013 12:27 pm
Forum: Flowcode V6
Topic: Wraping up Custom Components
Replies: 4
Views: 1491

Wraping up Custom Components

Hi, I am having a play with the new flowcode 6 demo and I have a custom file I would like to use with it. Is there a way to wrap it into a component?? I have seen it done on another thread but no explanation of how to actually do it. If anyone can do this I can either send the custom file to you, or...
by cobra1
Fri Nov 15, 2013 1:50 pm
Forum: General Programming
Topic: Floating math formula query
Replies: 3
Views: 2926

Re: Floating math formula query

Hi Ben Yes thats what i was looking at. _x0 = (float)ac1; So for the above i do the following?? Convert ac1 to a float X0 = ac1 I think this one would go something like this aswell z = ((float)_pu - x) / y; Convert _pu to float value Z =( _pu -x) / y Would that be correct?? Also one last thing what ...
by cobra1
Fri Nov 15, 2013 12:16 am
Forum: General Programming
Topic: Floating math formula query
Replies: 3
Views: 2926

Floating math formula query

Hi Im trying to work some floating point math in flowcode but im a little puzzled by a particular part of the math. Here is a large snippet of the code im copying. // calculate floating point cal factors _c3 = 0.0048828125 * ac3; // 160 * pow2(-15) * ac3; _c4 = 0.000000030517578125 * ac4; // 1E-3 * ...
by cobra1
Fri Aug 02, 2013 4:37 pm
Forum: General Programming
Topic: spi read from an arduino program
Replies: 9
Views: 3207

Re: spi read from an arduino program

* Function:SetBitMask * Description:set RC522 register bit * Input parameter:reg--register address;mask--value * Return:null */ void SetBitMask(uchar reg, uchar mask) { uchar tmp; tmp = Read_MFRC522(reg); Write_MFRC522(reg, tmp | mask); // set bit mask } /* * Function:ClearBitMask * Description:cle...
by cobra1
Fri Aug 02, 2013 4:05 pm
Forum: General Programming
Topic: spi read from an arduino program
Replies: 9
Views: 3207

Re: spi read from an arduino program

I have another question...


How would you deal with this?

WRITE_SPI (Register, Temp | Mask)

and also

WRITE_SPI (Register, Temp & (~Mask))


Mask = 0x80

Temp is a byte read from a read function.


I havnt done masking before so this is a bit new to me.
by cobra1
Fri Aug 02, 2013 1:36 pm
Forum: General Programming
Topic: spi read from an arduino program
Replies: 9
Views: 3207

Re: spi read from an arduino program

Thanks for clearing that up ben. Will see if it works when i get home :-)
by cobra1
Fri Aug 02, 2013 12:52 pm
Forum: General Programming
Topic: spi read from an arduino program
Replies: 9
Views: 3207

Re: spi read from an arduino program

Hi. Could this be converted to a flowcode chart?? uchar Read_MFRC522(uchar addr) {uchar val;digitalWrite(chipSelectPin, LOW); //address format:1XXXXXX0 SPI.transfer(((addr<<1)&0x7E) | 0x80); val =SPI.transfer(0x00); digitalWrite(chipSelectPin, HIGH); return val; I dont understand where return val i...
by cobra1
Fri Aug 02, 2013 10:37 am
Forum: General Programming
Topic: spi read from an arduino program
Replies: 9
Views: 3207

Re: spi read from an arduino program

Do you understand where the return val variable is being loaded from??
by cobra1
Fri Aug 02, 2013 10:33 am
Forum: General Programming
Topic: spi read from an arduino program
Replies: 9
Views: 3207

Re: spi read from an arduino program

Im using version 3. :-)
by cobra1
Fri Aug 02, 2013 10:21 am
Forum: General Programming
Topic: spi read from an arduino program
Replies: 9
Views: 3207

spi read from an arduino program

Hi. Could this be converted to a flowcode chart?? uchar Read_MFRC522(uchar addr) {uchar val;digitalWrite(chipSelectPin, LOW); //address format:1XXXXXX0 SPI.transfer(((addr<<1)&0x7E) | 0x80); val =SPI.transfer(0x00); digitalWrite(chipSelectPin, HIGH); return val; I dont understand where return val is...
by cobra1
Sat Feb 02, 2013 11:24 pm
Forum: General Programming
Topic: I2C between 2 PIC-Micros
Replies: 21
Views: 16331

Re: I2C between 2 PIC-Micros

I cant get my head round why the reads are done one after the other, if the interrupt is dissabled how does the i2c carry on receiving data?
by cobra1
Fri Feb 01, 2013 7:54 pm
Forum: General Programming
Topic: I2C between 2 PIC-Micros
Replies: 21
Views: 16331

Re: I2C between 2 PIC-Micros

Thanks for that Dazz,

So do you know if the i2c receives all the data and then processes it or does it process each byte on the go?

Looking at the code it seems it receives it all first, but i might be wrong there.
by cobra1
Thu Jan 31, 2013 9:06 pm
Forum: General Programming
Topic: I2C between 2 PIC-Micros
Replies: 21
Views: 16331

Re: I2C between 2 PIC-Micros

Can anyone help with this?