hybridfree/eevblog-posts huggingface dataset:
MSP430 Crystal Timer Problems - Page 1
Forum section: electronics / general

author: Jon86
author_rank: Frequent Contributor
timestamp: June 21, 2014, 02:17:22 pm
content: I'm trying to use an MSP430 timer with a 32.768Khz crystal to generate an interrupt every second increments the number on a 7-segment display.And I'm using the following code to set up the clocks etc.Code:WDTCTL = WDTPW | WDTHOLD;BCSCTL1 = CALBC1_1MHZ ;DCOCTL = CALDCO_1MHZ;P1DIR = 0xFF;P2DIR = 0xFF;P1OUT = 0x00;CCTL0 = CCIE;CCR0 = 32768;TACTL = TASSEL_1 + MC_2;__bis_SR_register(GIE);When the interrupt is run, I executeCode:CCR0 += 32768;But instead of a 1s interval, I'm getting somewhere around 5-6s. I'm pretty sure it's running from the crystal as when I remove it the timer stops counting.Does anyone know what might be wrong? And also could someone explain to me the process of setting up and resetting the timer? I'm not sure I understand the code properly.

author: TerminalJack505
author_rank: Super Contributor
timestamp: June 21, 2014, 03:54:24 pm
content: My suspicion would be this line here:Code:BCSCTL1 = CALBC1_1MHZ ;I'm guessing that the value of CALBC1_1MHZ has been lost and now holds a value of 0xff. This will cause the auxiliary clock (the 32.768kHz xtal) to be divided by 8--which would account for what you're seeing.SeethisStack Overflow post.

author: Jon86
author_rank: Frequent Contributor
timestamp: June 21, 2014, 03:59:50 pm
content: Looking at the BCSCTL1 Register, the value at runtime is 0x86 so apparently it's not being divided.

author: TerminalJack505
author_rank: Super Contributor
timestamp: June 21, 2014, 04:18:07 pm
content: That was my best guess. From what I can tell it should work as you are expecting it to based on the code that you show.

author: Jon86
author_rank: Frequent Contributor
timestamp: June 21, 2014, 04:20:55 pm
content: Damn, It's going to be a real pain in the ass to put an RTC in, ah well thanks anyway.

author: Jon86
author_rank: Frequent Contributor
timestamp: June 22, 2014, 04:01:05 pm
content: I think it's a hardware problem, if I unplug the board and plug it back in again after I've reprogrammed it, then it works fine.Also if I touch a scope probe on XOut then it works fine too, I'm guessing it's a capacitance problem, but I can't work out why it starts working if I plug it in again?
STPCD0175BTC3 troubleshooting - Page 1
Forum section: electronics / general

author: nitrokart
author_rank: Newbie
timestamp: June 20, 2014, 08:19:40 pm
content: Hello guys!I currently working on a dmx desk board witch have a STPCD0175BTC3 processor in it... But i doesn't boot! I doesn't do any thing!After a few hours of measuring everything I found that one of the RAM address lines is behaving strangely...In attachment is a print screen of my crappy PC Oscilloscope, as you can see, when power is connected, data have a max voltage around 3.3v, but after some time it doesn't go higher that 1.6v...Do you think the processor is faulty, or should I look somewhere else??Thanks!Greetings from Portugal!
Papilio rotary encoder wing  - Page 1
Forum section: electronics / general

author: hamster_nz
author_rank: Super Contributor
timestamp: June 19, 2014, 11:30:21 pm
content: Gadget Factory have a one-day sale on for their new Rotary Encoder with tricolour LED.http://store.gadgetfactory.net/products.php?product=Encoder-WingI might bling up my next project a little.(and yes I do know Jack and get the occasional free item or maybe a prototype from GF, but I did pay my own hard cash for one of these)
The hottest forum for mcu programmer in the world!!! - Page 1
Forum section: electronics / general

author: clarkzh
author_rank: Newbie
timestamp: June 09, 2014, 02:53:20 am
content: every one, i think this might be a little improper to ask the question here. yes i think this is also a very good forum for mcu programmer.but what is the hottest forum for mcu programmer in the internet? thank for any recommendations~

author: westfw
author_rank: Super Contributor
timestamp: June 09, 2014, 05:17:29 am
content: It depends on what you consider "hot", and your level of expertise. The Arduino forums see an incredible amount of traffic, covering several different processor architectures and a lot of peripheral and real-device interfacing. But there are an awful lot of clueless beginners :-( There are other forums where the level of expertise is higher, but you'll be flamed to toast (or ignored) if you're a clueless beginner and ask a bad question...

author: clarkzh
author_rank: Newbie
timestamp: June 09, 2014, 06:23:21 am
content: Quote from: westfw on June 09, 2014, 05:17:29 amthanks a lot, your senior guy. I like Auduino, also I do not want bother beginners 's very basic question.but, every one is ever be a beginner. to reply to such question is not silly but a great helper.....although I am also tired of it.anyway that is another thing. do you know any other than Auduino?

author: mtdoc
author_rank: Super Contributor
timestamp: June 09, 2014, 07:06:44 am
content: Well, there's alwaysAVR Freaks

author: clarkzh
author_rank: Newbie
timestamp: June 09, 2014, 08:25:05 am
content: Quote from: mtdoc on June 09, 2014, 07:06:44 amthank you, I visited this site. it is really very hot. and it seems very carefully managed. very good.then. I am a ARM M0 and 51 programmer. I also need forums on such MCUs. any recommendation?

author: westfw
author_rank: Super Contributor
timestamp: June 09, 2014, 09:53:09 am
content: Some of the linkedin forums (groups) seem to be hitting enough of a critical mass to get some interesting discussions going. The ARM group is one of them (https://www.linkedin.com/groups?home=&gid=85447)The "requirements" for a good forum are interesting; it looks like a certain percentage of thick-skinned beginners with silly questions is necessary, for instance. I could swear that the various vendor-run forums (ti, microchip) suffer from not enough people being willing to admit that they don't know something.Here (eevblog) can be good, too.

author: jimjam
author_rank: Regular Contributor
timestamp: June 15, 2014, 03:34:33 pm
content: The mikrocontroller.net site seems like a good site. Too bad it's in GermanI'm actually looking for something like that in English.
ARM CMSIS - Something wrong with trig functions? - Page 1
Forum section: electronics / general

author: SolarSunrise
author_rank: Regular Contributor
timestamp: June 13, 2014, 07:35:27 pm
content: I was trying to get the CMSIS DSP library working on my STM32F4. In my program, I utilized trig functions to calculate data for windowing. But I noticed that these trig functions were somewhat inaccurate:I ran an example program, which calculated sin^2(x) + cos^(x) where x is random data in radians, and this is what I got:(Ideally these should be 1)0.9999627470.9999642970.9999641180.9999625680.9999830130.9999688270.9999844430.9999783640.9999723430.9999936820.9999746680.9999749660.99999576810.9999980930.9999696020.9999778870.9999868270.9999629860.9999757410.9999935630.999965310.999962330.9999721650.9999729390.9999744890.999987960.9999725220.999990880.9999921920.999974310.999977529Well you can see the tolerances of these results are +/-0.001. According to the example program, they should've been +/-0.0000001Did I screw something up? Can anyone try out the example (CMSIS/DSP_Lib/Examples/arm_sin_cos_example) and see if the tolerances are any better? This seems a little bit too inaccurate for a "good" library...Thanks in advance!EDIT:It turned out that the example program I was running was written 2 years ago. The new documentation points out the tolerances are +/-0.0001.LESSON LEARNED: NEVER USE OUTDATED PROGRAMS. Damn it spent 4 hours trying to figure out this crap.

author: dannyf
author_rank: Super Contributor
timestamp: June 13, 2014, 08:36:04 pm
content: I got one 0.9999998, and the rest are roughly 50/50 between 0.9999999 and 1.The calculation for those functions is via a set of look-up tables so it is very difficult to go wrong.

author: dannyf
author_rank: Super Contributor
timestamp: June 13, 2014, 08:37:21 pm
content: QuoteI was using dsp 1.0.3. And the example was written in 2010.
dsPIC MCPWM period skipping - Page 1
Forum section: electronics / general

author: NiHaoMike
author_rank: Super Contributor
timestamp: June 09, 2014, 02:49:57 am
content: I'm working on an inverter with a dsPIC controller. I have the sine wave generation code running well, but now I want to add period skipping at particularly high or low duty cycles in order to improve efficiency. For those who don't specialize in power electronics, period skipping is a trick that involves alternating between periods of full on or full off and periods where the on time or off time is doubled, effectively halving the switching frequency.Here's (part of) the code:Code:unsigned int pwm;//code to calculate initial PWM valueif(pwm>600) {if(PWMtick&0x1) { //PWMtick is a variable that increments every PWM periodpwm=(pwm<<1)-801; //this doesn't seem to workif(pwm>775)pwm=801; //801 commands 100% duty cycle}elsepwm=801;}else if(pwm<200) {if(PWMtick&0x1) {pwm=pwm<<1; //but this does!if(pwm<25)pwm=0;}elsepwm=0;}The result is that at low duty cycles, it does indeed skip periods as intended. But at high duty cycles, it just abruptly switches to full on. The code for the high and low duty cycles are identical except for some comparison constants and the PWM value calculation. Is there something peculiar about the dsPIC and/or the XC16 compiler that causes that calculation to fail?
Help! STM32 IO voltage problem. - Page 1
Forum section: electronics / general

author: clarkzh
author_rank: Newbie
timestamp: June 06, 2014, 08:07:54 am
content: dear all.I?need to interface with a machine port( which internal i can not see) , i use stm32 m0 MCU IOs. in the soft ware. i configure:bidirectional data line( yellow wave) OD, and use 10k pull down resistor and a 10k pull up resistor.then i got the wave like this. the lower waves( MCU output ), higher(MCU in).as you can see ,that the output wave become lower voltage.the input, very strange .this cause the communication unstable. as you can see in the right part of the oscolloscope. the MCU just can not output the wave.i think the problem may be the drive/ sink ability of my IOs. or the internal partsshould you please help me to solve this strange problem??in the pictures, MCU output is in rectangle box. but input in circle.thank you~~~

author: Psi
author_rank: Super Contributor
timestamp: June 06, 2014, 08:11:24 am
content: I'm not sure i understand you, but..Are you are driving the output in open collector mode so the output can rest at half rail?You need to make the last bit of digital data in every packet a zero, otherwise the output will be held low until the next bit.

author: clarkzh
author_rank: Newbie
timestamp: June 07, 2014, 01:13:38 am
content: Quote from: Psi on June 06, 2014, 08:11:24 amthanks Psi, yes i drive the output/input in open collector(or open drain)mode. and i am to make a zero for each package. you are right. but my problem may not come from here.the voltage of the input/output line( color yellow in my attached) is not good. ?I?have low voltage( indicated by rectangular box) when set it at output line. and high when set it as input line.I guess i have incorrect setting of my bidirectional line, hardware, or firmware. I used both external pull up and pull down resistors. and open drain in the MCU io.

author: Jeroen3
author_rank: Super Contributor
timestamp: June 07, 2014, 11:18:39 am
content: MCU inputs have schmitt triggering, 0.5*Vdd is not really allowd be the hardware. Unless you can disable the schmitt triggering, you'l have troubles.My best guess is to put the pin in analog mode.

author: rob77
author_rank: Super Contributor
timestamp: June 07, 2014, 12:27:11 pm
content: why are you using pull-up and pull-down at the same time ? what kind of bus it is ? if it's plain logic level coupling then biasing to 1/2 of the supply rail is not a good idea.

author: dannyf
author_rank: Super Contributor
timestamp: June 07, 2014, 01:54:35 pm
content: -and i am to make a zero for each package. -maybe it is a language thing but the above and others like that are impossible to understand. -not good- or - not working- has no meaning to others and carries no information.instead, describe what you are trying to do, how you are doing it, and what problems you are having would be helpful.after you have put it down on a piece of paper, show it to your mom or your brother or a roommate and see if they understand it - you have to assume that we have no knowledge about your project.
CPLD JTAG pin repurposing - Page 1
Forum section: electronics / general

author: gregallenwarner
author_rank: Regular Contributor
timestamp: June 06, 2014, 09:48:39 pm
content: I'm still new to programmable logic devices, and you guys have given me good tips for FPGA's in the past, but I've got a question regarding CPLD's.Since I'm still a newbie to programmable logic, I decided rather than try and start big with FPGA's, I'll just start learning with CPLD's instead, until I get the hang of VHDL and stuff. My question is in regards to the JTAG pins on my CPLD.I'm using an Altera MAX3000A EPM3064A. The JTAG pins are labelled as IO/Txx (whatever the JTAG pin name is for that particular pin). Does this mean that those pins can either be used by the JTAG programmer OR be used for GPIO?If I am able to repurpose the JTAG pins as GPIO, how does the chip know whether it is supposed to be receiving programming data on those pins, or behaving as GPIO? To better illustrate my question: The SPI pins on an AVR, for example, can be used for programming, but once the program is running, they can be used as GPIO. The way the chip knows the difference is whether or not the RESET line is being held low. If it is, then the chip is in "programming" mode, and those pins serve as the ICSP. If RESET is HIGH, then the pins can be used for GPIO.I am unsure what mechanism the MAX3000 uses, analogous to the AVR's RESET line, to indicate whether the JTAG pins should accept programming or behave as GPIO. How does this work?

author: Crazy Ape
author_rank: Regular Contributor
timestamp: June 07, 2014, 03:36:31 am
content: According to the Altera Knowledge Base, 11v on OE1 allows you to override the disabled setting."The OE1 pin is the VHJ pin during programming mode which must be set to 11 volts to override the "disable JTAG pins" bit on the device."http://www.altera.com/support/kdb/solutions/rd02212005_950.html

author: gregallenwarner
author_rank: Regular Contributor
timestamp: June 07, 2014, 12:33:47 pm
content: I see. So if I wanted to use the JTAG pins for GPIO, I'd have to set the "Disable JTAG Pins" bit, after which JTAG would be inaccessible until I reset it with the high voltage procedure described?
AVR - is it possible to set interrupts on a port instead of a pin? - Page 1
Forum section: electronics / general

author: kolonelkadat
author_rank: Regular Contributor
timestamp: June 06, 2014, 04:49:28 am
content: Im using an atmega 328p with a small keypad attached. The keypad is attached to port C (analog 0-5).What I would like to do is have an interrupt that wakes the microcontroller when any of the keys are pressed. Is there a way to do this?

author: ve7xen
author_rank: Super Contributor
timestamp: June 06, 2014, 05:10:20 am
content: Pin Change interrupt. Should be available on most pins, and you can enable many at once. Only one ISR is fired regardless of which pin changes, you then need to poll to figure out which one(s) were triggered.Didn't actually read the link, but this looks like it covers it:https://sites.google.com/site/qeewiki/books/avr-guide/external-interrupts-on-the-atmega328

author: kolonelkadat
author_rank: Regular Contributor
timestamp: June 06, 2014, 05:33:47 am
content: perfect! thanks.

author: dannyf
author_rank: Super Contributor
timestamp: June 06, 2014, 10:09:34 am
content: QuoteOR those pins into one single interrupt pin - check to make sure that it can wake up the mcu from your sleep mode.

author: SirNick
author_rank: Frequent Contributor
timestamp: June 06, 2014, 06:35:12 pm
content: Uhh, I don't see any advantage to using external logic when the PCInt method is exactly what the OP is looking for... ?

author: Jeroen3
author_rank: Super Contributor
timestamp: June 07, 2014, 11:21:34 am
content: The PCINT is probably incapable of creating a wake-up from deep sleep. This is probably exclusively for the INT pins.

author: Psi
author_rank: Super Contributor
timestamp: June 07, 2014, 11:41:37 am
content: Quote from: Jeroen3 on June 07, 2014, 11:21:34 amnope, PCINT can wake up an AVR from all sleep states.PCINT is a true interrupt, like INTx.
Does anyone have any experience of TI Hercules micro-controllers - Page 1
Forum section: electronics / general

author: Simon
author_rank: Unknown
timestamp: June 06, 2014, 08:36:30 am
content: I've started reading through a datasheet for one of the Hercules mcu's from TI, and while I'm not understanding every detail I can see that there is plenty of error protection built into every part of it but I'm yet to find information on what actually happen's when there is an error other than a fault signal and some registers being written.Has anyone got any experience of these mcu's that can give me a low down on what using then entails ?, do they need additional governing circuitry to manage faults, are they mostly self correcting and seamless to the user and do they require specific code to deal with errors ?I have a starter kit on order so hopefully get to play soon as it seems that is the easiest way to get some appreciation of how they work.
Atmel Studio 6.2, AVRISP MKII Clock resets too high - Page 1
Forum section: electronics / general

author: igendel
author_rank: Frequent Contributor
timestamp: June 05, 2014, 12:27:51 am
content: Hello,I just installed Atmel Studio 6.2, alongside the 6.1 I already had.I'm trying to program an ATtiny85 with some very simple code and 1MHz clock speed (internal oscillator) on the fuses.Everything works fine on the 6.1; I set the ISP clock of the AVRISP MKII programmer to 125KHz, build and upload as usual.On the 6.2, however, a repeating error occurs: after the build, when the upload should start, it tells me thatAtmel Studio was unable to start your debug session.Please verify device selection, interface settings, target power and connections to the target device. Look in the details section for more information.Timestamp: 2014-06-05 03:19:46.230Severity: ERRORComponentId: 20100StatusCode: 131101ModuleName: TCF (TCF command: Device:startSession failed.)Unexpected signature 0x00000000 (expected 0x001e930b).When I open Tools->Device Programming, I see that the ISP clock has reset for some reason to 1MHz, which is too high for the fuse settings on the MCU. I can set it manually to 125KHz and read the signature/fuses from the MCU all right, but when I close this dialog and try to upload, the error repeats.Has anyone else encountered this kind of error? Any ideas?Thanks!

author: igendel
author_rank: Frequent Contributor
timestamp: June 05, 2014, 01:33:12 pm
content: Quote from: mojo-chan on June 05, 2014, 01:11:19 pmBut I did; the project properties tab shows "125KHz" correctly (this number also appears on the project config file, forgot what it's called). Still, when it's time to burn, the error comes up and when I open the "Device programming" dialog, I have to "Apply" the programmer again, and it says 1MHz.

author: igendel
author_rank: Frequent Contributor
timestamp: June 05, 2014, 04:28:13 pm
content: Quote from: mojo-chan on June 05, 2014, 03:59:59 pmThanks, already posted thereSomeone suggested an updated build of 6.2 (.1156 instead of .1153), but it too didn't help.
Half Duplex Software Serial for ATtiny and PIC16F - Page 1
Forum section: electronics / general

author: bequest333
author_rank: Contributor
timestamp: June 06, 2014, 01:06:42 am
content: Hi,AllI will introduce A small Software Serial Routine for ATtiny and PIC16F.8bit,NP,1STOP (Output, but will be 2 stop bits, No problems.)(ATtiny13A) 1+16+10=27words.cseg.equ xtal = 9600000 ;Hz.equ baud = 9600 ;bps.def rs =R17 ;bit delay counter.def cn =R18 ;bit shift counter.def rxd =R19 ;data buffer#define TX 3 ; TX Data output pin (i.e. 2 = PORTB,2)#define RX 4 ; RX Data input pin (i.e. 3 = PORTB,3).org XXXXSBI DDRB,TX ; set TX Port; ********************************************************************;; RS-232C Send 1byte (16words);; set rxd and call;; ********************************************************************PUTC:SBI PORTB,TXLDI cn,2*(1+8+1) ; 10-bit DataRJMP PC+5 ; Start bitROR rxd ; Rotate Right through CarryBRCC PC+2SBI PORTB,TX ; set TX='1' if Carry='1'BRCS PC+2CBI PORTB,TX ; set TX='0' if Carry='0'RCALL bwait ; wait 1 bitBRNE PC-6 ; loopbwait:RCALL bwait2 ; wait 1 bitbwait2:LDI rs,(xtal/baud-22)/6-1SUBI rs,1BRCC PC-1DEC cnRET; ********************************************************************;; RS-232C Recieve 1byte (10words);; return in rxd;; ********************************************************************GETC:SBIC PINB,RXRJMP GETC ; wait Start bitRCALL bwait2 ; wait 1/2 bitLDI cn,2*(1+8) ; 9-bit DataROR rxd ; set DataRCALL bwait ; wait 1 bitSBIS PINB,RXCLCBRNE PC-4 ; loopRET(PIC10F322) 2+18+12=32wordsxtal EQU 8000000 ;Hzbaud EQU 9600 ;bps#define TX 2 ;PIC TX Data output pin (i.e. 2 = RA2)#define RX 3 ;PIC RX Data input pin (i.e. 3 = RA3)cblock 0x7Ecn ;bit shift counterrxd ;data bufferendcorg XXXXclrf ANSELA ; digital I/Obcf TRISA,TX ; set TX Port; ********************************************************************;; RS-232C Send 1byte (18words);; set W and call;; ********************************************************************PUTC:bsf LATA,TXmovwf rxd ; rxd=wcall bitout+3 ; start bitmovwf cn ; cn=9rrf rxd,f ; set Carrycall bitout ; wait 1bitdecfsz cn,f ; send 9bits?goto $-3 ; loopbitout:btfsc STATUS,C ; Bit Outputbsf LATA,TXbtfss STATUS,Cbcf LATA,TXbwait:call bwait2 ; wait 1 bitbwait2:movlw .256-((xtal/.4)/baud-.15)/.8addlw 0x01btfss STATUS,Zgoto $-2retlw 0x09; ********************************************************************;; RS-232C Recieve 1byte?12words?;; return in W and rxd;; ********************************************************************GETC:btfsc PORTA,RXgoto GETC ; wait Start bitcall bwait2 ; wait 1/2 bit and W=9movwf cn ; cn=9rrf rxd,f ; get bit datacall bwait ; wait 1 bitbtfss PORTA,RXbcf STATUS,Cdecfsz cn,f ; cn=0?goto $-5 ; loopmovf rxd,w ; return in wreturn
Pickit 2 C# sources - Page 1
Forum section: electronics / general

author: Vasi
author_rank: Regular Contributor
timestamp: June 01, 2014, 04:27:05 pm
content: Anyone having Pickit2 PC software sources (the version 2 was written in C#) and willing to share them? You can't find them anymore on Microchip's site.Thank you very much!

author: jaxbird
author_rank: Frequent Contributor
timestamp: June 01, 2014, 04:36:06 pm
content: You can try this unless they've crypto obfuscated the code:http://www.jetbrains.com/decompiler/

author: neslekkim
author_rank: Super Contributor
timestamp: June 01, 2014, 09:16:41 pm
content: Quote from: Vasi on June 01, 2014, 04:27:05 pmYou mean Pickit3 right? You find the sources for that here:http://www.microchip.com/pagehandler/en-us/devtools/dev-tools-parts.htmllook for the "PICkit 3 Programmer App and Scripting Tool", sources are in an zip inside that file.

author: Vasi
author_rank: Regular Contributor
timestamp: June 01, 2014, 09:44:37 pm
content: No, I mean exactly Pickit2 version 2.x, written in C#...I have version 1.x sources written in Borland C++ 6 (compilable with the personal edition).

author: hans
author_rank: Super Contributor
timestamp: June 02, 2014, 08:48:33 am
content: Never knew they were up for download.The binaries are not obfuscated, so you can easily "pull it apart" with a program like ILSpy or something similar.You get reasonable code. Comments are lost, as well as variable names of local stuff. Most other things is in there and up for grabs.You could quite easily figure out how their USB thing works and write command-line USB scripts for/with the PICKIT 2/3 this way.

author: macboy
author_rank: Super Contributor
timestamp: June 03, 2014, 06:09:21 pm
content: I have sources for version 2.40 in C#.I will attempt to post it here; it is almost 4 MB compressed.THis is a multi-part 7zip archive, and each part is individually compressed into a zip file for posting (7z is not allowed). Decompress the 4 parts, then open the .001 part with 7zip.

author: macboy
author_rank: Super Contributor
timestamp: June 03, 2014, 06:10:07 pm
content: Parts 3 and 4 of the archive.
EEPROM emulation program for LPC8XX. - Page 1
Forum section: electronics / general

author: bequest333
author_rank: Contributor
timestamp: June 05, 2014, 06:48:28 am
content: Hi,AllI will introduce the EEPROM emulation program LPC8XX.<Specification of emulation program>1. Program Size:128Tumb words (256 bytes) It is rewritten r2 and r1 register in running.2. EEPROM address:15 (0x00 ~ 0x0E)3. EEPROM data:0x00000000 ~ 0x0FFFFFFF(268435455)4. Virtual EEPROM spaceTwo pages using Flash contiguous area of 16 words (64 bytes),In test program, Page0:0x00000D00?0x00000D3F and Page1:0x00000D40?0x00000D7F.5. Functioninitial_eeprom Initialize write 0xFFFFFFFF to EEPROM area.read_eeprom r2=EEPROM(r1)write_eeprom EEPROM(r1)=r26. Use register(max) 3(r0,r1,r2)Specifies the start address of the working buffer register r0,16+5 words working buffer (84 bytes) required.Writing,It does not write reading when the specified value is out of the range,to return to rewrite the value of register r1.read/write status ----> EEPROM address is greater than 0x0E r1 |= 0x80write status ----> EEPROM data is greater than 0x0FFFFFFF r1 |= 0x40Reading,The return to rewrite the value of the register r1 when there is no data in the EEPROM specified address,0x0FFFFFFF is set in the r2 register at this time.read status ----> There is no data in the specified EEaddress ?r1 |= 0x207. Example of the use of assemblerldr r0,=#XXXXXXXX @Set the start address of the working buffer to r0movs r1,#Y @Set the EEPROM address in r1ldr r2,=#ZZZZZZZZ @Set the EEPROM data to r2bl write_eeprom @Subroutine call8. Data format of internal flashEEdata =< 0x0FFFFFFF EEdata (upper 28bits)EEaddress < 0xF EEaddress (lower 4 bits)EEPROM Data Format(word): [EEdata31:4|EEaddress3:0]9. RestrictionPage1 and Page0 shall be placed in a 128-words boundary.O PAGE0=0x00000E00, PAGE1=0x00000E40X PAGE0=0x00000E40, PAGE1=0x00000E80O PAGE0=0x00000E80, PAGE1=0x00000EC0X PAGE0=0x00000EC0, PAGE1=0x00000F00O PAGE1=0x00000E00, PAGE0=0x00000E40X PAGE1=0x00000E40, PAGE0=0x00000E80O PAGE1=0x00000E80, PAGE0=0x00000EC0X PAGE1=0x00000EC0, PAGE0=0x00000F00Test circuitMore Information.https://translate.google.co.jp/translate?sl=ja&tl=en&js=y&prev=_t&hl=ja&ie=UTF-8&u=http%3A%2F%2Fwww3.hp-ez.com%2Fhp%2Fbequest333%2Fpage58&edit-text=Test Program Download.ZIP file is possible to import from LPCXpresso as compressed project.http://hp.vector.co.jp/authors/VA058115/common/lpc810_EEPROM.zip
setting up for different options with different programming pinouts - Page 1
Forum section: electronics / general

author: Simon
author_rank: Unknown
timestamp: May 21, 2014, 09:40:11 am
content: I'm looking at using an ATtiny20 or 24, I'm not sure which although it's looking like the 24 as I can actually get it but the pinouts are different for the avrisp2 programmer. Can i lay my board out so that each track from the programming header goes to both options of the programming pins (non coincide with different ones) so that either chip I use it will work. Will this case a problems if I have a signal on a pin that was not expecting it or do all the pins go off when in programming mode ?Also on the ATtiny24 there is no SCK pin but there us a USCK pin, is that the same ?

author: ajb
author_rank: Super Contributor
timestamp: May 24, 2014, 05:22:40 am
content: All of the GPIO pins go tri-state when in programming mode except for the ISP pins and the clock pins which will do whatever they've been configured to do via the CLKSEL fuses. If your design can spare the extra pins you shouldn't have any problems tying the different ISP pins together. As an alternative, you could use a couple of 0-ohm resistors as jumpers to route the ISP signals to suit whichever part is populated on the board. As far as which pins you need to use, check the section in the datasheet on serial programming, as some ports use different pins than others for ISP. It'susuallythe SPI pins on the Mega/Tiny parts, but not always!

author: Simon
author_rank: Unknown
timestamp: May 24, 2014, 06:34:53 am
content: ok, so what happens to the programming pins during normal operation? As far as i know by default all IO pins start as high impedance input pins so should not be a problem if I'm not using those pins for anything else.

author: Jeroen3
author_rank: Super Contributor
timestamp: May 24, 2014, 03:10:44 pm
content: You should refer to the manaul or datasheet for specifics, but all pins are floating during reset, except reset. Shortly after that a few pins go different, including programming pins.This also includes possible bootloader selection pins, which might also change pin modes for serial/can/usb/crystals.If you must use the isp pins for other purposes you must make sure you do not interfere with the programming capabilities. And any possible programming interference does not harm the board or application. (or any humans/animals in that case)For example, you should not put a H-bridge on the programming pins, since the H-bridge is able to create a short circuit.When connecting stuff to programming pins also consider that a LED might still work, but a strong pullup or pulldown (or capacitor) will make your chip unprogrammable. You'd have to buy pre-programmed chips for your boards... $$$.
Recommendations for C RTOS design pattern book - Page 1
Forum section: electronics / general

author: Harvs
author_rank: Super Contributor
timestamp: May 18, 2014, 02:35:29 am
content: As the title suggests, got any recommendations for good books of C design patterns for RTOS based embedded systems?I'm just getting into using FreeRTOS, I've read their books on how to use it, now I'm just looking for further reading on how best to use the RTOS tools available in the broader sense of building an application.

author: Kremmen
author_rank: Super Contributor
timestamp: May 20, 2014, 11:56:46 am
content: I was almost sure i had something in my shelf but turned out not to be the case exactly. I have the first item in this link and while it is a good book it does not address your question directly and it may be a bit much for what you were specifically asking.http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps&field-keywords=Model-Based%20Engineering%20of%20Embedded%20Real-Time%20SystemsThat book is relevant to the topic however since in my opinion one of the keys to successful application of design principles such as use of an RTOS, is modeling. You should model the problem and then model the solution to match the problem. Elements of the solution model contain the features of the RTOS in use but it is important to realize that just throwing an RTOS at a problem is not enough - it must also be applied in a way that makes sense. Often previously invented design patterns are helpful just as you note.

author: Harvs
author_rank: Super Contributor
timestamp: May 20, 2014, 12:34:29 pm
content: Quote from: Kremmen on May 20, 2014, 11:56:46 amThanks for the link, it's available at the library so I'll pick it up for a read.

author: Q-Kernel
author_rank: Contributor
timestamp: May 20, 2014, 05:59:03 pm
content: Quote from: Harvs on May 18, 2014, 02:35:29 amHave a look at the user guide of Q-Kernel even if you don't want to use this RTOS. It describes things like Publish/Subscribe mechanism how to prevent global variables and in general how to accomplish "High Cohesion, Low Coupling".You can download the user guide and all source code at the QuasarSoft website.

author: Harvs
author_rank: Super Contributor
timestamp: May 21, 2014, 12:47:13 am
content: Quote from: Q-Kernel on May 20, 2014, 05:59:03 pmThanks, it's not really what I was looking for though. FreeRTOS has a somewhat similar user guide with basic descriptions of some patterns.When I was learning C# (not that you ever really stop), I was able to pick up full text books that fully described not just the basic overview of patterns, but the indepth implications of each pattern and how they should and shouldn't be used. This was extremely helpful in getting a deeper understanding. I was hoping for something like that for RTOS on *microcontrollers.*like M3/M4 sized uCs.
WIFI Module Identification - Page 1
Forum section: electronics / general

author: diyaudio
author_rank: Frequent Contributor
timestamp: May 19, 2014, 11:42:19 am
content: Hi GuysI bought this off ebay, now I need the datasheet for it, Google doesn't reveal much, does anyone know who makes this? or where I can find a datasheet for it?.Thanks

author: firewalker
author_rank: Super Contributor
timestamp: May 19, 2014, 12:28:15 pm
content: Have a look to the link bellow.http://www.ebay.com/itm/HC-21-Embed-WIFI-to-Serial-Port-Wireless-Module-UART-HC21-/251471741483Alexander.

author: diyaudio
author_rank: Frequent Contributor
timestamp: May 19, 2014, 12:44:28 pm
content: Quote from: firewalker on May 19, 2014, 12:28:15 pmMany thanks! you replied faster than my seller (and still waiting for hes reply)

author: amyk
author_rank: Super Contributor
timestamp: May 19, 2014, 12:45:17 pm
content: The documents in that link are for a completely different module.The MAC OUI is "Smart Energy Instruments" but that's probably not indicative.The model number leads to "Beijing SimpleWifi" andthis Chinese documentthat shows what's inside.Also is it just me or does that external antenna look completely unconnected.

author: Ribster
author_rank: Frequent Contributor
timestamp: May 19, 2014, 02:49:25 pm
content: Isn't that trace from the connector going into C37??

author: Scrts
author_rank: Frequent Contributor
timestamp: May 20, 2014, 02:24:12 pm
content: Quote from: Ribster on May 19, 2014, 02:49:25 pmYes, so you can solder it to use PCB antenna or leave it as-is for external antenna (use of external connector).
LGTSDK - Page 1
Forum section: electronics / general

author: dannyf
author_rank: Super Contributor
timestamp: May 16, 2014, 03:33:22 pm
content: Interesting approach - works with gcc-avr and iar-avr.http://www.lgtic.com/wp-content/uploads/2014/05/LGTSDK_Builder_Quick_Start.pdfLooks to be more for the Arduino crowd, given the simplicity of the UI in the pdf file.

author: amyk
author_rank: Super Contributor
timestamp: May 17, 2014, 11:50:21 am
content: Good thing they didn't have a 'B' in their name.

author: Psi
author_rank: Super Contributor
timestamp: May 17, 2014, 12:19:46 pm
content: was thinking the same thing

author: dannyf
author_rank: Super Contributor
timestamp: May 17, 2014, 04:35:04 pm
content: I just tried it. Quite interesting.Pros:1) fairly modern but minimalist UI;2) auto-detects winavr - zero configuration on my part;3) extensive built-in drivers for avr/lgt - beats out arduino;4) highly integrated: from device configuration, editing, build to program, all in one;5) small download (just over 2MB + .net). No installation required....Cons:1) resizing of windows not quite working;2) limited support: two devices (lgt8f88 / atmega88 and one other).

author: dannyf
author_rank: Super Contributor
timestamp: May 17, 2014, 04:36:11 pm
content: This is the code I ran:Code://===================================================// Auto generated file : 5/17/2014 12:22:39 PM//===================================================#include "allinone.h"// Import external definitionsextern void init_modules(void);int main(void){// Device initializationinit_modules();DrvGPIO_EnableOutput(B, OUT1);// Add your code from herewhile (1) {DrvGPIO_TogglePort(B, OUT1);}return 0;}Output on the chip (simulation):
Best forum for IAR EWARM wanted - Page 1
Forum section: electronics / general

author: euzer
author_rank: Regular Contributor
timestamp: May 13, 2014, 12:12:46 pm
content: Can anyone recommend a non-processor specific forum covering IAR EWARM, or failing that the most popular processor-specific forum for it?I'd like to know if there's a way to compare two different build configurations without manually inspecting the multitude of settings in the project/file options dialogue boxes.

author: jmag999
author_rank: Contributor
timestamp: May 13, 2014, 12:47:14 pm
content: Try Winmerge on the project file.http://winmerge.org/

author: dannyf
author_rank: Super Contributor
timestamp: May 13, 2014, 01:27:00 pm
content: IAR may have a forum for that.As far as I know, no automated tools exist for that.

author: fake-name
author_rank: Regular Contributor
timestamp: May 14, 2014, 05:06:07 am
content: Does it use ASCII configuration files (if it doesn't, it should).Those should be pretty easy to diff using one of the many tools for that out there.

author: euzer
author_rank: Regular Contributor
timestamp: May 14, 2014, 09:46:46 am
content: It uses xml. All the settings for all build configurations and any overridden files are contained within one file so they have to be split out to separate files to diff them and then the xml tags for any different settings need interpreting. All quite a laborious process and not a great improvement on manual comparison of dialogue box settings.It's quite easy to loose track of the consistency of settings for multi builds with optional file overrides and is an issue I've come across on other IDEs.In fact has any IDE got a good solution for this?

author: gmb42
author_rank: Frequent Contributor
timestamp: May 14, 2014, 11:16:15 am
content: I've used XML diff tools in the past, can't remember what, a quick Google search turns upDiffXML.

author: engineer_in_shorts
author_rank: Regular Contributor
timestamp: May 16, 2014, 08:39:09 am
content: Not that i am aware of but sounds like a good idea to diff the xml.I just found out that you can pass the project file in command line, kinda like a make file, if you need to build from command line. Maybe i am a bit behind the times!
Implementing some digital logic in an old Bitcoin miner - Page 1
Forum section: electronics / general

author: blub
author_rank: Newbie
timestamp: May 11, 2014, 07:44:31 am
content: Well, I have watched the FPGA video, and got my hands on an old Bitcoin miner. I dont have much infos on it, but there should be four xilinx fpgas on it(seems reasonable as there are 4 heatsinks on the board). Now I want to implement some basic digital logic on it, but I do have no Idea how to start.I dont want to learn Verilog or VHDL.What I want is some graphical interface where I See all the programmable logic arrays and select for each one which logic element it is and which it connects to.Any way to do this?

author: Fsck
author_rank: Super Contributor
timestamp: May 11, 2014, 07:54:38 am
content: you mean like schematic entry? it's doable but a painful way to do anything even slightly complex.and, some of those miners are built with fpgas not covered in the free version of vivado/ise

author: blub
author_rank: Newbie
timestamp: May 11, 2014, 09:14:14 am
content: yes, I think that is what I need,yes I know its not optimal, I just want to do some designs this way because i want to.

author: marshallh
author_rank: Unknown
timestamp: May 14, 2014, 12:38:15 am
content: You're screwed, you can't do it like you want.Instead learn VHDL or Verilog. I think t hose miners probably have Spartan-6s on them so you need to use ISE. If you want to just play around with something, blink LEDs with an arduino. This will take a lot of time and effort to get going.

author: miguelvp
author_rank: Super Contributor
timestamp: May 14, 2014, 01:19:29 am
content: Xilinx ISE doesn't support schematic entry?I'm glad I use Altera's Quartus II that doesTo the OP, since it's on dedicated hardware you might find it very difficult to program it, and when or if you do, you might not have access to pins that you can designate. A dev board would have been easier than some bitcoin miner already configured to do what it does. Not impossible since it's probably flashable but without documentation it will be almost imposible.It would be like using a Rigol Scope as an FPGA dev board, not worth it, but if you want to share more info/pictures of the device maybe someone can point you to where to get the documentation for it.BTW kidding about Xilinx not having an schematic editor, because of course it does.Another thing is that you can convert Verilog/VHDL modules to schematic and use them as well provided you know what it does within the module, but it will expose the input/ouputs/inouts & buffers in schematic form. Well at least Quartus can, never used ISE.Edit: for example this thing:http://fpgamining.com/products/x6500-rev3even if you could program it via JTAG what could it do if you don't have access to any pins to look on what is doing?Edit2: oh and BTW you are going to need to do a boundary scan to see what device is in there or pull the heatsinks because you will need to know the device in order to program it.
VHDL. this signal is connected to multiple drivers. Help me please TODAY!!! - Page 1
Forum section: electronics / general

author: timgep
author_rank: Newbie
timestamp: May 11, 2014, 12:48:57 pm
content: I have main entity for example.I also have RAM 16*8bit component. Which has port (address, accessing indicator, reading indicator, writing indicator, IN/OUT DATA)So, first 16 clock cycles I need to read main's entity input (byte_input). And send it to RAM component.From 16 to 32 clock cycles, I have to read data from RAM, process it and rewrite again to ram component from 32 to 48 clock cycles.But I stalled in the first part. I can't even read entity's input and send it to the RAM. When synthesizing it says "Multi-source in Unit <top_module> on signal <ram_data<2>>; this signal is connected to multiple drivers"Code:Code:PROCESS(clk)BEGINif(rising_edge(Clk)) thenif (cnt>=0 and cnt<16) thenram_data<=byte_input;end if;end if;end process;gate_1: ram16x8 port map(address=>ram_address,csbar=>'0',oebar=>'0',webar=>ram_webar,data=>ram_data);

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: May 11, 2014, 01:02:47 pm
content: Everything that drives the RAM address lines must be assigned within the same process.You should probably also be using dual-port RAM to make things simpler

author: timgep
author_rank: Newbie
timestamp: May 11, 2014, 01:24:44 pm
content: Quote from: mikeselectricstuff on May 11, 2014, 01:02:47 pmI put everything in one process as you said. But problem did not disappear.Could you please correct me if I am wrong. I have some doubts that I can use component and process in one entity. Should I separate them? (but it is harder to control ram within other entity)

author: timgep
author_rank: Newbie
timestamp: May 11, 2014, 02:15:41 pm
content: gate_1: ram16x8 port map(address=>ram_address,csbar=>'0',oebar=>'0',webar=>ram_webar,data=>byte_input);When I changed data pointer directly to byte_input, it was possible to synthesize.But I need somehow to control when and what I am sending in to RAMAlso I found another mistake with previous case:Code:Hierarchical block <gate_1> is unconnected in block <top_module>. It will be removed from the design.

author: Scrts
author_rank: Frequent Contributor
timestamp: May 12, 2014, 02:12:09 pm
content: You have to use tristate (which MUST be instantiated in the top module) and control tristates OE signal.
how to indent VHDL and VERILOG sources ? (looking for an app/tool) - Page 1
Forum section: electronics / general

author: legacy
author_rank: Super Contributor
timestamp: May 04, 2014, 06:22:38 pm
content: hi guysi need to "indent" a lot of VHDL and VERILOG code,just in order to make it look prettierare there any tools to do that ?i can use both Windows/Linux

author: nctnico
author_rank: Super Contributor
timestamp: May 04, 2014, 07:10:04 pm
content: There are code beautyfier tools which apply a certain formatting to a source file. Google 'code beautyfier'.

author: legacy
author_rank: Super Contributor
timestamp: May 04, 2014, 07:14:06 pm
content: i found C/C++ beautifier, are you sure there is a VHDL/VERILOG ones, too ?if so, any suggestion about the specific one i'd better use ?

author: jahonen
author_rank: Super Contributor
timestamp: May 04, 2014, 07:49:57 pm
content: Emacs VHDL mode has a beautifier at least for VHDL.Regards,Janne

author: legacy
author_rank: Super Contributor
timestamp: May 04, 2014, 08:20:02 pm
content: umm, if it is possible i'd prefer something i can use in script (bash or windows), i have a tone of .vhd files to be beautified

author: FrankBuss
author_rank: Unknown
timestamp: May 04, 2014, 08:25:05 pm
content: Quote from: legacy on May 04, 2014, 08:20:02 pmI'm sure for the experts it would be just 3 lines of Emacs Lisp code

author: legacy
author_rank: Super Contributor
timestamp: May 04, 2014, 08:46:34 pm
content: i do not know anything about lisp and emacs but .. i can learn it

author: zapta
author_rank: Super Contributor
timestamp: May 05, 2014, 01:15:37 am
content: Some ide's and editors can operate on entire directory trees, try eclipse, sublime, textpad, etc.Sent from my Nexus 5 using Tapatalk

author: scientist
author_rank: Frequent Contributor
timestamp: May 06, 2014, 06:33:54 pm
content: The Mojo IDE automatically formats VHDL,http://embeddedmicro.com/tutorials/mojo/mojo-idealthough it's only in alpha.

author: maxslug
author_rank: Newbie
timestamp: May 08, 2014, 04:29:36 am
content: If you're prettying it up just to browse you might consider usinghttp://www.burbleland.com/v2html/v2html.htmlto make your life easier.-m
Seeking pros / cons on mini-32  - Page 1
Forum section: electronics / general

author: 22swg
author_rank: Frequent Contributor
timestamp: May 10, 2014, 02:11:01 pm
content: Tried chipkit UNO found it restrictive HW and SW , any feedback on MikroElektronika mini-32 appreciated.http://www.mikroe.com/mini/pic32/
Arduino and Processing Launchpad type thing - Page 1
Forum section: electronics / general

author: Rihards Veips
author_rank: Contributor
timestamp: April 28, 2014, 07:12:33 pm
content: I am trying to make something similar to a Novation Launchpad with buttons connected to my arduino.The arduino sends a serial message and Processing receives it and if it is "1" it plays a sound[Using MINIM] but I have a problem that the sound plays only one time and then doesn't react to the serial messages.If you could help me please do(My computer broke the Processing code file... when I write it again I will update this topic, but if anyone could write me one that would be awesome)[[Arduino code]]==============================================================const int buttonPin = 2;int buttonState = 0;void setup() {pinMode(buttonPin, INPUT);}void loop(){buttonState = digitalRead(buttonPin);if (buttonState == HIGH) {Serial.print("1");}else {delay(10);}}

author: Hideki
author_rank: Frequent Contributor
timestamp: April 28, 2014, 10:38:23 pm
content: Right now, the code will try to send "1" as fast as it possibly can, as long as you're holding the button down. That's badWhat you will want to do is to only send the "1" when the button state changes from up to down, then stop sending.One easy way to do this is to keep track of the previous state.Declare a new variable and add prevState = buttonState; right before you do digitalRead.Then change the next line to: if (buttonState == HIGH && prevState == LOW) {To do button debouncing, it's better to put a delay right after you send the "1" and just delete the "else" part.Note that it's common to let the input be HIGH through a pullup resistor then connect the input to ground when you push the button.Either way works, but since the AVR has built-in pullups you can avoid using additional resistors.

author: Rihards Veips
author_rank: Contributor
timestamp: April 29, 2014, 12:21:14 pm
content: I have a 100ms delay after the Serial.print() forgot to add thata to the post, but the problem is with Processing - it only plays a sound one timeQuote from: Hideki on April 28, 2014, 10:38:23 pm

author: Hideki
author_rank: Frequent Contributor
timestamp: April 29, 2014, 06:34:53 pm
content: I don't know much about Processing, but you won't get much help from anyone if you don't show any code