hybridfree/eevblog-posts huggingface dataset:
Referencing but not emitting ROM constants in C18 - Page 1
Forum section: electronics / general

author: gxti
author_rank: Frequent Contributor
timestamp: February 18, 2012, 05:50:45 pm
content: I've been working on some simple firmware for the PIC18F66J60 based on the Microchip Internet bootloader and TCP/IP stack. I've gotten everything working great, but I need a way to easily program MAC addresses. What I've done is set aside a spot in the bootloader's program space at 0xFBF0, and altered the bootloader to use that instead of the #defines it came with. No problem.Code:#pragma romdata BOOTMAC=0xFBF0static far rom BYTE BootMAC = {0xBE, 0xEF, 0xCA, 0xDE, 0x00, 0x00};#pragma romdata// ...memcpypgm2ram((void*)MyAddress.vMAC, (far rom void*)BootMAC, sizeof(MyAddress.vMAC));But now I want to use this same config value to set up registers in the actual application. The gist is that by having the MAC burned into the bootloader's area, I can use the bootloader to update the firmware "in the field" without overwriting the pre-programmed MAC. So first I tried using the same declaration as above, but now the .hex file contains a value for 0xFBF0 which I don't want because it belongs to the bootloader and the bootloader (rightly) refuses to program it and fails the upload. Then I tried using "extern" instead of "static", but the linker doesn't find a definition for the variable and fails. Third I tried not referencing the program memory directly and instead just reading the MAC back out of the SFR, but for some reason that came out as all zeroes. Finally I worked around the problem by having the bootloader skip over the 0xFBF0 chunk. But it's kind of ugly, and I'm curious if there's a way to solve this properly using C18. Other possibilities that I don't especially like include using assembly to copy it out, and passing it from the bootloader to the application through RAM. Any ideas?

author: Short Circuit
author_rank: Frequent Contributor
timestamp: February 18, 2012, 09:24:34 pm
content: Code:#define BOOTMAC 0xFBF0memcpypgm2ram((void*)MyAddress.vMAC, (far rom void*)BOOTMAC, sizeof(MyAddress.vMAC));

author: gxti
author_rank: Frequent Contributor
timestamp: February 18, 2012, 10:41:29 pm
content: Now I feel incredibly silly. Thank you, kind sir.
Dead Launchpad FET - Page 1
Forum section: electronics / general

author: alexwhittemore
author_rank: Frequent Contributor
timestamp: February 16, 2012, 06:34:56 pm
content: I ran into what I'm pretty certain is a hardware issue with my Launchpad board today. I've used it successfully before, but CCS started complaining about no USB FET present. Comparing with my same chip and a friend's board, it looks like the flash emulation portion of the board just up and kicked the bucket on me. Maybe I shocked it or something without knowing.Anyway, has anyone had a similar issue? Anyone know if there's a way to reset the FET portion? For $4.30 it's almost certainly not worth my time, but hey, I hate to waste a good board.

author: vtl
author_rank: Regular Contributor
timestamp: February 17, 2012, 01:57:15 am
content: Does the device show up in device manager? (I assume you're using Windows). If so you might try flashing the firmwarehttp://processors.wiki.ti.com/index.php/MSP430_LaunchPad_Firmware_UpdateI must say these boards are pretty resilient though, I've accidentally short circuited VDD to VSS many times and the internal protection on the board works a treat.

author: alexwhittemore
author_rank: Frequent Contributor
timestamp: February 17, 2012, 09:42:35 pm
content: I mean, shorting VDD and GND should be the last thing that *Bricks* a device. If you haven't considered that contingency, you're just not trying.But anyway, no, the device fails to install automatically in a new machine, then doesn't show in device manager, hence my suspicion it's beyond repair. But I'll have a look at the link when I get a chance, thanks!
Microchip 16F A/D converter VRef - Page 1
Forum section: electronics / general

author: Unix
author_rank: Newbie
timestamp: February 07, 2012, 07:01:35 pm
content: Hi Everyone,I have only joined a few weeks ago and this is my first post to this forum.I am using the analogue to digital converter on the 16F690 and am going to need to use an external voltage reference for the conversion.My question is this: can the voltage I apply to the VREF pin be greater than vdd?I have used the A/D before using both the internal Vddref and also an external Vref which was below vdd. But can the external VRef be above Vdd? Will the chip handle the extra current without damage and will it be able to do the calculations with the Ref being between 6V - 12V?Any help is appreciated.Rich

author: SeanB
author_rank: Super Contributor
timestamp: February 07, 2012, 07:41:55 pm
content: Simple answer is no. Either divide the reference to below the supply and similarly divide the input to below the supply rails or use a different reference that is below the supply rail. All the inputs have protection diodes that will clamp to a little above the supply voltage, and if you have enough input current the chip will turn into a pretty poor SCR and let the smoke out.

author: Unix
author_rank: Newbie
timestamp: February 07, 2012, 07:50:55 pm
content: Hi SeanBThanks for the reply.Your answer was going to be my fall back - to use a voltage divider to split up the high reference voltage.I should have guessed that it would have been too convenient the other way..Thanks.
Microchip forcing MPLAB X? - Page 1
Forum section: electronics / general

author: caffeinatedbard
author_rank: Regular Contributor
timestamp: February 06, 2012, 03:16:32 pm
content: I went to try and download MPLAB 8.83 and it seems Microchip killed the links and are gently forcing people to download mplab x.anyone else have the same problem?-bard

author: 8086
author_rank: Super Contributor
timestamp: February 06, 2012, 03:18:39 pm
content: The download link works here.

author: caffeinatedbard
author_rank: Regular Contributor
timestamp: February 06, 2012, 04:49:34 pm
content: I found the issue.It works in internet explorer just fine. I was using google chrome and I am pretty sure there were some parsing errors.I also heard back from the FAE, that the website is in the process of being updated so there might be some broken links here and there.Thanks 8086 for checking that out.

author: MikeK
author_rank: Super Contributor
timestamp: February 07, 2012, 02:52:54 am
content: Microchip does a poor job of having their website work properly on all browsers. Just try to use their forums with FireFox.
6502 Resurrected - Page 1
Forum section: electronics / general

author: AntiProtonBoy
author_rank: Frequent Contributor
timestamp: January 26, 2012, 01:05:46 pm
content: Probably old news for some of kids posting here, but I found the resurrection of the 6502 microprocessor somewhat interesting.http://www.h-online.com/open/news/item/Relaunched-the-6502-microprocessor-1422007.htmlSeems more like a nostalgia toy than anything else. Or perhaps a drop-in replacement part for damaged old equipment.

author: tinhead
author_rank: Super Contributor
timestamp: January 26, 2012, 01:11:39 pm
content: new is only that mouser is WDC distri

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: January 26, 2012, 01:13:01 pm
content: http://uk.mouser.com/ProductDetail/Western-Design-Center-WDC/W65C02S6TPG-14/?qs=sGAEpiMZZMvu0Nwh4cA1wSNu7hWmGrIdvYIw7nZ2DMI%3d"This product may require a licence to export from the United States."ROTFL

author: EEVblog
author_rank: Unknown
timestamp: January 26, 2012, 01:38:07 pm
content: Quote from: mikeselectricstuff on January 26, 2012, 01:13:01 pmCome on, this is serious business and a seriously powerful chip! Iran could use it to do nuclear weapons simulation or something. The technology must be protected at all costsDave.

author: tinhead
author_rank: Super Contributor
timestamp: January 26, 2012, 02:18:14 pm
content: Quote from: EEVblog on January 26, 2012, 01:38:07 pmlast year i ordered some 6522 i/os directly from WDC, no issues at all, mouser is funny

author: AntiProtonBoy
author_rank: Frequent Contributor
timestamp: January 26, 2012, 05:36:38 pm
content: Clearly, it has a 1024-bit crypto hardware as an easter egg.

author: nitro2k01
author_rank: Frequent Contributor
timestamp: February 06, 2012, 02:12:10 am
content: These classic microprocessors are still in relatively wide use in embedded systems. I was delighted to find a 65c02 in an LCD monitor I was repairing. (The repair was just replacement of faulty caps, though.) But 6502 is still for sale, both as chips and as VHDL. However, WDC's version is not fully compatible with MOS6502. In particular, all undefined opcodes are NOPs. So don't expect to be able to pop this into a C64 and be able to run games and demos.Quote from: AntiProtonBoy on January 26, 2012, 05:36:38 pmThis is not as out there as it seems. A certain brand of smart cards is using an 8051or 8052 core and it has — you guessed it — hardware crypto acceleration. 3DES in this case, so not quite 1024 bits, but I wouldn't be surprised if there's some smart card or similar that has a 6502 core and some 1024-bit crypto.

author: Psi
author_rank: Super Contributor
timestamp: February 06, 2012, 05:38:23 am
content: Quote from: tinhead on January 26, 2012, 02:18:14 pmDigikey are no better.They wont ship pulsar brand pcb toner transfer products to NZ or AUS....Making your own circuit boards?... what? only terrorists do that!

author: joelby
author_rank: Frequent Contributor
timestamp: February 06, 2012, 06:21:28 am
content: Odd! Within Australia, you can buy PulsarProFX fromUltrakeet(the starter kits seem to be out of stock, but the refills are available).
just found this programmer - Page 1
Forum section: electronics / general

author: siliconmix
author_rank: Frequent Contributor
timestamp: February 01, 2012, 01:12:05 pm
content: http://www.botkin.org/dale/rs232_interface.htm.

author: jimmc
author_rank: Frequent Contributor
timestamp: February 01, 2012, 01:23:33 pm
content: I'm getting a 404 on that link.Jim

author: deephaven
author_rank: Frequent Contributor
timestamp: February 01, 2012, 01:28:02 pm
content: just drop the '.' after htm

author: Unknown
author_rank: Unknown
timestamp: February 01, 2012, 01:45:12 pm
content: This is not a programmer, just a convoluted solution replacing a MAX232 by something not conforming to the RS-232 spec: funny stuff if flow control kicks in, no negative voltages, may not be happy if the output is shorted or connected to +/- 25 V.

author: metalphreak
author_rank: Frequent Contributor
timestamp: February 03, 2012, 06:56:05 am
content: I used a similar setup for dumping the DVD-rom drive key from my Lite-on Xbox 360 drive. It work's ok depending on your Serial port hardware and what you are trying to do, but in a pinch it works ok

author: siliconmix
author_rank: Frequent Contributor
timestamp: February 03, 2012, 08:20:22 am
content: thanks .i should imagine it's quite stable using the fets.

author: deephaven
author_rank: Frequent Contributor
timestamp: February 03, 2012, 09:02:42 am
content: You can make your own Pickit 2 see here:http://www.obddiag.net/picprog.htmlIt uses a programmed PIC itself, if you need a hand in getting that I can program it for you.

author: siliconmix
author_rank: Frequent Contributor
timestamp: February 03, 2012, 09:04:01 am
content: cheers.might take you up on that.

author: westfw
author_rank: Super Contributor
timestamp: February 04, 2012, 01:29:35 am
content: The first time I saw this (or similar mosfet-based circuit), I got a distinct uncomfortable feeling about mosfet gates connected mostly directly to external wires of indeterminate length. When I asked around, I did get some comments to the effect that it did tend to burn out, so I reverted to the original Serial Arduino circuit (this was for a single-sided serial Arduino.)
PIC16F877A Input problems - Page 1
Forum section: electronics / general

author: pelle.jansen
author_rank: Contributor
timestamp: February 06, 2012, 07:41:57 pm
content: Hello all,I am having difficulty interfacing my PIC16F877A microcontroller with 8 momentary buttons.It only seems to be reading properly from RB0, 1 and 7. The other pins seem to be low even though I have 10K external pull up resistors to +6V. The circuit is pretty simple: 8 MHZ crystal to CLK with 22pF caps to groud, entire PORTD with apropriate resistors to LED's and entire PORTB with 10K pull up resistors to switches directly to ground. MCLR is tied high.Here is the code written in Hi Tech PICC:Code:/******************************************************* Pelle Jansen* 5 - 2 - 2012** PIC16F877A button IO test** X1: 8 MHZ, 2 22 pF capacitors to ground* *****************************************************/#include <htc.h> // main PIC header file#include "delay.h" // for DelayUs()#include "delay.c" // for some reason necessary for DelayMs()/* External high speed 8 MHZ crystal oscillator, Watchdog timer disabled* brown out reset enabled, EEPROM protection disabled* write protect disabled, code protect disable, Low voltage programming disabled* power on timer enabled.*/__CONFIG(FOSC_HS & WDTE_OFF & BOREN_ON & CPD_OFF & WRT_OFF & CP_OFF & LVP_OFF & PWRTE_ON);/*definitions*/#define XTAL_FREQ 8 MHZ/*main function*/void main (void){TRISD=0; // PORTD as outputTRISB=1; // PORTB as inputwhile (1) // infinite loop{PORTD=PORTB;}}The LED's are fine as I can light every individual one of them with success but when I try to read digital status from PORTB RD0, 1 and 7 works fine but others almost always return 0. When trying to use single ports in an if statement (RB2 in this case) it sometimes decides to work but than it fails again. I feel like I'm overlooking something simple and stupid like an configuration bit. I am still pretty new to uCs so if you can help me out it would be greatly appreciated.Oh and by the way, I am using MPLAB X on OS X 10.6.8 and am using a PICKIT 3. If you need any more info just askThanks

author: DrGeoff
author_rank: Frequent Contributor
timestamp: February 06, 2012, 07:47:36 pm
content: Your really need this for all the pins to be inputs.TRISB = 0xff

author: MikeK
author_rank: Super Contributor
timestamp: February 06, 2012, 07:52:12 pm
content: What Geoff said.Your statement TRISB = 1 is equivalent to TRISB = 0x00000001. See why it isn't setting the necessary pins as inputs?

author: pelle.jansen
author_rank: Contributor
timestamp: February 06, 2012, 07:55:03 pm
content: Quote from: MikeK on February 06, 2012, 07:52:12 pmThat was quick, didn't even have time to type!Now I get it. Thanks. According to the datasheet power on defaults are 1 so if I would completely remove that line it should solve it!EDIT:That means that the output port setting also is wrong. But why did it work?Well I get it now. Thanks for the input
anyone know what software for this one ? - Page 1
Forum section: electronics / general

author: siliconmix
author_rank: Frequent Contributor
timestamp: February 02, 2012, 02:34:14 pm
content: bought this in a boot sale .it powers up ok .but its got no brand name .anyone seen one before.looks like there room for other mcu's on there.

author: AntiProtonBoy
author_rank: Frequent Contributor
timestamp: February 02, 2012, 03:16:05 pm
content: All I'm seeing is a very poor quality photo of a bunch of generic IC components. Without any circuit board markings, it's hard to tell, unless someone recognises the board layout.
Found cheap development board source - Page 1
Forum section: electronics / general

author: GeoffS
author_rank: Unknown
timestamp: February 01, 2012, 05:29:36 am
content: A bit of browsing around for a cheap AT91SAM board, I cam across this sitewayengineerThere are lots of microcontroller, FPGA, CPLD boards listed as well as other goodies, JTAG programmers etc,THe hardware is very cheap, I haven't found any software development tools as yet but will do a bit more digging.

author: joelby
author_rank: Frequent Contributor
timestamp: February 01, 2012, 06:59:52 am
content: Thanks for the tip! I've added the FPGA boards to my directory of cheap FPGA boards.The prices for displays seem good, too - only $25 for a 7" TFT, for instance.
Creation of a variable in ASM file for PIC 12F675  - Page 1
Forum section: electronics / general

author: EENG
author_rank: Contributor
timestamp: January 22, 2012, 11:48:48 am
content: HalloI am busy getting familiar with the whole ASM SW for programming the pic PIC 12F675 in my PIC KIT 1 demo board. I am a first time programmer.In one of the demo files they create two variables as shown below (question follows afterwards):;************************** VARIABLE DEFINITIONS ******************************cblock 0x20STATE_LED ; LED state machine counterSTATE_DEBOUNCE ; button debounce state machine counterendc;***************************************************************************Question:1. What does cblock 0x20 exactly do?2. How does one ascertain how big the variable is? In notherwords, when I create a variable, is it 8bits wide? Or 16 bits wide?3. Suppose I wanted to create a variable that was 32bits wide, how does one do this?

author: Unknown
author_rank: Unknown
timestamp: January 22, 2012, 12:19:21 pm
content: cblock/endc allocates the following variables at the address 0x20, see MPASM help or any decent tutorial. All registers, and hence assembly variables, are 8 bit wide on 8-bit PICs. Longer variables will have to be split across several registers, and for arithmetic you'll have to do something likethis.Higher level programming languages like C will do this automatically.

author: westfw
author_rank: Super Contributor
timestamp: January 22, 2012, 09:16:16 pm
content: You'll want to look athttp://ww1.microchip.com/downloads/en/DeviceDoc/33014K.pdfThe manual for the assembler. This is often neglected in between the device datasheets and architecture descriptions and "make it work" tutorials, but you need it to explain the details of the tools.

author: Bambur
author_rank: Regular Contributor
timestamp: January 26, 2012, 02:00:01 pm
content: Here are answers to your questions 2 and 3.cblock START_ADDRESSVar1:1 ; 8-bit wide variableVar2:2 ; 16-bitVar3:4 ; 32-bitendcPIC Assembler is very easy!
Using a microcontroller as a Pushbutton - Page 1
Forum section: electronics / general

author: AndyFroncioni
author_rank: Contributor
timestamp: February 05, 2012, 02:04:01 pm
content: I have this device that uses a momentary pushbutton. I want to replace the manual activation of this button with an automated closing of the switch, using an AtMega328p.Will I need a solid-state relay? The switch needs to be shorted, but I think I should isolate its voltage levels from the main board, right?

author: tbscope
author_rank: Contributor
timestamp: February 05, 2012, 02:25:07 pm
content: In general a relay is a good idea.What voltage and current are you talking about?The voltage and current a microcontroller can supply is very limited.If you don't need isolation, a transistor can be sufficient too.Watch out with how much current you need to operate the relay, especially if you add multiple relays to the microcontroller.

author: Bloch
author_rank: Unknown
timestamp: February 05, 2012, 02:25:36 pm
content: Use a normal relay - then you are not sure about the rest off the circuit.

author: vtl
author_rank: Regular Contributor
timestamp: February 05, 2012, 02:34:27 pm
content: You can use an optoisolator if you like. Will not be as power hungry as a relay if you just want to switch a signal.

author: AndyFroncioni
author_rank: Contributor
timestamp: February 05, 2012, 02:41:33 pm
content: Options are: normal relay, opto-isolator, and transistor. The choice depends on the current that will likely be flowing through the switch. Got it.Thank you very much for your answers, folks!

author: AndyFroncioni
author_rank: Contributor
timestamp: February 05, 2012, 08:35:08 pm
content: Just to close the loop on this question... Now that I had your help for determining the search-space, I looked up the details on the innerweb:Transistor and relay as a switch:http://www.kpsec.freeuk.com/trancirc.htmOptoisolator as a switch:http://www.arunet.co.uk/tkboyd/ec/ec1optoiso.htm

author: nitro2k01
author_rank: Frequent Contributor
timestamp: February 06, 2012, 02:22:56 am
content: What you should depends very much on what the button actually does. If it just connects to ground or the positive rail and doesn't carry a large current, and the Atmega328 is running on the same voltage as the rest of the circuit, you might be able to drive it directly with an IO pin. If it does source/sink a relatively large current, an external transistor might be preferable. If you need isolation or the switch is connected through a more complex arrangement (such as matrix arrangement to use more buttons than there are IO pins on the controlled system's microcontroller) you'll typically need an optocoupler or transistor. If you need isolation, an optocoupler or relay is needed.In short, it all depends. Maybe you could tell us a little bit about your actual application?
PIC 18F4550 - Page 1
Forum section: electronics / general

author: cabocan
author_rank: Newbie
timestamp: January 24, 2012, 10:41:44 am
content: Hi , does anybody know a good programmer circuit I can build for programming my PIC18F4550 ?

author: Teknotronix
author_rank: Regular Contributor
timestamp: January 24, 2012, 10:45:50 am
content: While not a circuit you can build, I use the PICKit 3 to program PIC's from the same family. Find it works very well and is relatively cheap.

author: joelby
author_rank: Frequent Contributor
timestamp: January 24, 2012, 11:52:00 am
content: Agreed. You can spend a lot of time building the perfect programmer, or just buy a PICkit 3! There's currently a 20% off promotion:http://microchiptechnology.wordpress.com/2012/01/17/20-discount-on-pickit/.They're very cheap for what they are, and it's a tool you'll be able to use for years.

author: kripton2035
author_rank: Super Contributor
timestamp: January 24, 2012, 12:17:37 pm
content: there is also this one, clone, half the price shipped ...http://www.ebay.com/itm/ws/eBayISAPI.dll?ViewItem&item=350526544131

author: metalphreak
author_rank: Frequent Contributor
timestamp: January 24, 2012, 01:35:28 pm
content: You can build your own programmer using an 18F2550 (or an 18F4550) but the catch is you need to program it firsthttp://usbpicprog.org/These are good if you just want to program chips (no debugging etc)

author: cabocan
author_rank: Newbie
timestamp: January 24, 2012, 03:58:05 pm
content: Thanks guys.I will take a look at these.

author: Zad
author_rank: Super Contributor
timestamp: January 24, 2012, 08:06:53 pm
content: If you have a parallel port on your PC:http://lmgtfy.com/?q=pic+parallel+port+programmerSimilar ones exist for the serial port too.
PIC16F747 with HI-TEC C - Page 1
Forum section: electronics / general

author: grimmjaw
author_rank: Regular Contributor
timestamp: January 19, 2012, 03:53:09 pm
content: Hi guys,I just recently entering the wonderfull world of microcontroller and bought myself the PICkit 3 Debug express.The kit came with PIC18f45k20 demo board with C18 compiler.After playing around with the board (blinking led etc) , I decided that I want to build a new project with PIC16F747.I'm using HI-TEC C compiler to program the pic.Unfortunately I cannot find the header file or the linker file for the PIC16F747.Does anyone idea where can i find these file or am I heading towards a wrong path.Thanks for the helpgrimmjaw

author: Rufus
author_rank: Super Contributor
timestamp: January 19, 2012, 04:16:48 pm
content: No linker file is required and including <htc.h> should pull in the required headers for the processor selected in MPLAB.If you want to look at the header for your processor it is pic16f747.h and should have been installed with the compiler.

author: mobbarley
author_rank: Regular Contributor
timestamp: January 20, 2012, 03:59:34 am
content: are you using that chip for the triple pwm? catch: they all use the same frequency

author: grimmjaw
author_rank: Regular Contributor
timestamp: January 20, 2012, 08:21:45 am
content: @Rufus:thanks for the info..It seem to be working now (no error)@mobbarley:Yup..I planning to play around with RGB led...with same frequency, meaning that all 3 pwm have the same duty cycle or the same speed?say red at 10%,blue at 30% and green at 50%..or all three colour have to be 10%....I'm at the office now..cannot really test it myself.Thanks againgrimmjaw

author: mobbarley
author_rank: Regular Contributor
timestamp: January 20, 2012, 01:08:27 pm
content: They just run at the same frequency. You can do an RGB LED easily with any PIC thats clocked reasonably fast - just use a timer interrupt so that the frequency is consistent to avoid glitches.

author: mobbarley
author_rank: Regular Contributor
timestamp: January 21, 2012, 05:49:14 am
content: And if you don't already have the 16f747's laying around you are probably way better off with a more modern pic, try the 18f2XK22 series, something like 5 PWMs or 1 full and 2 half bridges with a spare pwm left over.

author: grimmjaw
author_rank: Regular Contributor
timestamp: January 24, 2012, 02:48:39 pm
content: @mobbarley:I actually have 16f747 laying around but thanks for the tip
“Project Idea” contest – win a STM32F4DISCOVERY kit - Page 1
Forum section: electronics / general

author: mindThomas
author_rank: Contributor
timestamp: January 22, 2012, 04:25:34 pm
content: Are you interested in winning a freeSTM32F4DISCOVERYkit?The kit is made by STMicroelectronics and contains their new STMF4 microcontroller with a Cortex-M4 core with FPU and better performance.If you are going around with a good idea for an electronics project with some kind of microprocessor then write the idea to us - the category/theme doesn't matter!We will then select the best idea and idea owner will get a free kit. In the meanwhile we will try to complete the project and upload details, pictures and source codes.You can read more about the contest, the rules and which mail you should send your ideas to at our blog:http://blog.tkjelectronics.dk/2012/01/project-idea-contest-win-a-stm32f4discovery-kit/
Data EEPROM on a PIC12F675 - Page 1
Forum section: electronics / general

author: deephaven
author_rank: Frequent Contributor
timestamp: December 22, 2011, 10:35:56 am
content: It would be convenient for me to use the Data EEPROM to save some initialisation data in the EEPROM section of the PIC12F675. However, Microchip recommends using the FLASH program memory for such storage which I'd prefer not to do. They talk about the need to do an "array refresh" in order to use the EEPROM but can't see any info on what that entails. Can anyone enlighten me?This is from their datasheet:The Data EEPROM is a high-endurance, byte addressablearray that has been optimized for the storage offrequently changing information (e.g., programvariables or other data that are updated often).Frequently changing values will typically be updatedmore often than specifications D120 or D120A. If this isnot the case, an array refresh must be performed. Forthis reason, variables that change infrequently (such asconstants, IDs, calibration, etc.) should be stored inFLASH program memory.

author: Bored@Work
author_rank: Super Contributor
timestamp: December 22, 2011, 03:57:15 pm
content: http://www.microchip.com/forums/tm.aspx?m=59054&mpage=1&settheme=Mobile

author: deephaven
author_rank: Frequent Contributor
timestamp: December 22, 2011, 04:15:41 pm
content: Quote from: BoredAtWork on December 22, 2011, 03:57:15 pmMany thanks, I did do a search on that very forum, but missed that thread. Sounds like it will be ok as long I don't have frequently changing data updating the EEPROM as well.

author: Graham1904
author_rank: Newbie
timestamp: January 22, 2012, 10:06:53 am
content: OOI I use the PIC's own EEPROM all the time for such configuration data. I even put ASCII text in the EEPROM next to the variable to remind me in the future what the variable is there for

author: deephaven
author_rank: Frequent Contributor
timestamp: January 22, 2012, 04:04:21 pm
content: Quote from: Graham1904 on January 22, 2012, 10:06:53 amSounds like a good scheme! My requirement is as minimalist as you could get, I only need to save the state of one bit!
Question on use of #define versus EQU in PIC ASM language - Page 1
Forum section: electronics / general

author: EENG
author_rank: Contributor
timestamp: January 22, 2012, 06:19:44 am
content: HalloI am busy getting familiar with the whole asm code structure for programming the pic PIC 12F675 in my PIC KIT 1 demo board. I am a first time programmer. Forgive me if I dont use the exact words to describe the SW function/variable names etc. as the terminology is all new. I will put a question mark in brackets (?) after a word if I am not sure that I used the correct terminologyIn a piece of code that I am analysing, I see they make use of this statement:#define D0_ON B'00010000'From what I understand, the variable (?) D0_ON is assigned the 8 bit word whose binary value is 00010000. Then in the code they move this D0_ON value to the output port GPIO as shown below:movlw D0_ONmovwf GPIOIn ASM coding, I understand that they also use the EQU function For exampleD0_ON EQU 10h ;*** i.e. the binary value 00010000 in hex ***movlw D0_ONmovwf GPIOMy understanding is that the ‘EQU’ instruction simply means something equals something else. Therefore, is there any difference in the above two examples or is there a distinct rule when one must use the #define in certain instances instead of the EQU?

author: westfw
author_rank: Super Contributor
timestamp: January 22, 2012, 06:54:23 am
content: Both of your examples will produce the same code.But there's a technical difference:"#define" defines a MACRO, which causes a text substitution when you use it. (This is sort-of copied from the C language. Most assemblers (including MPASM) have another type of macro common to assemblers that works differently.)"equ" defines a label-style SYMBOL, which gets assigned a (numeric, I think) value, and you can use it where you would have used that value.So since D0_ON is just a number, your examples behave the same.But you could have said:Code:#define D0_ON GPIO,4bsif D0_ON ;; turn on just the specified bitwhileD0_ON equ GPIO,4would have caused an error.A major reason to use the #define form is that the same set of definitions can be used for C programs as well as assembler.A major reason to use the "equ" form is that the symbol will show up in cross reference listings and debuggers.

author: EENG
author_rank: Contributor
timestamp: January 22, 2012, 08:47:18 am
content: Thanks for your kind assistanceSo much clearer now....the journey of a 1000 miles starts with the first step....I am taking small learning steps and with your reply its opened up a new avenue of understanding

author: Graham1904
author_rank: Newbie
timestamp: January 22, 2012, 10:09:52 am
content: Also I think that EQU dates back to the early dark ages of Microchip assembler (circa 1980), then C programming was not an option. Use #define and that is at least ANSI C compatible
PICKIT2 Demo Board PIC18F Support - Page 1
Forum section: electronics / general

author: Stephen Hill
author_rank: Regular Contributor
timestamp: January 16, 2012, 02:20:23 pm
content: Hi All,I've just bought a PICKIT 2 Starter Kit which includes the Low Pin Count Demo Board. On this board is a 20PIN PIC16F690 but I would really like to start working with the PIC18F.The datasheet for this demo board states that only PIC12F and PIC16F devices are supported, however, the ICSP pins for the PIC18F are exactly the same as the supplied PIC16F690.So in theory it should work but I would like to hear for you guys (the experts) if it's possible to drop in a PIC18F into this board?Many ThanksStephenDM164120-1 - PICkit Low Pin Count Demo Board:http://www.microchipdirect.com/ProductSearch.aspx?keywords=DM164120-1PIC16F690 Datasheet:http://ww1.microchip.com/downloads/en/devicedoc/41262a.pdfPIC18F1XK2 Datasheet:http://ww1.microchip.com/downloads/en/DeviceDoc/41365C.pdf

author: Stephen Hill
author_rank: Regular Contributor
timestamp: January 16, 2012, 03:43:28 pm
content: After reading the datasheet of the Demo Board, PIC16 and PIC18 a bit more, my gut feeling is that the PIC18 should work without any problems.So I'm gonna give it a try and if it fails, well then I'll just have to wire up my PIC18F on a breadboard.CheersStephen

author: PedroDiogo
author_rank: Regular Contributor
timestamp: January 16, 2012, 03:53:33 pm
content: Quote from: Stephen Hill on January 16, 2012, 03:43:28 pmI may be mistaken but a friend of mine replaced the original chip that came with the Low pin count board with a PIC18F14K50 and it worked perfectly.

author: im_a_human
author_rank: Regular Contributor
timestamp: January 16, 2012, 11:03:27 pm
content: Check out the circuit diagram for the pic demo board and the pinout for the device you want to use just to be sure.

author: Jon Chandler
author_rank: Frequent Contributor
timestamp: January 17, 2012, 12:52:20 am
content: I believe that either the 18F14K50 or 18F13K50 chips will work. Be aware that there are some limitations regarding the USB pins even when USB is not being used. The 18F14K22 and 18F13K22 should work without the USB peripheral.
PWM control module. - Page 1
Forum section: electronics / general

author: firewalker
author_rank: Super Contributor
timestamp: November 10, 2011, 03:29:14 pm
content: Is there any general purpose PWM modules with microcontroller input in order to drive "high" power DC devices? E.g. 12 volt 3 Amps pwm module. I am sure I had came across with such devices but can find them now (it was something like solid state relay).Alexander.

author: Unknown
author_rank: Unknown
timestamp: November 10, 2011, 09:24:49 pm
content: Do you mean a MOSFET?

author: firewalker
author_rank: Super Contributor
timestamp: November 10, 2011, 10:12:47 pm
content: ??. ? MOSFET is a discrete component. It was like a solid state relay as I said (actually a very fast ssr).

author: Balaur
author_rank: Unknown
timestamp: November 10, 2011, 10:37:57 pm
content: As Alm suggested, a logic-level MOSFET transistor is a perfect candidate for your application.However, all depends on the application you have in mind:a) If you already have a perfectly good DC Power Source (constant voltage), a MOSFET is all you needb) If you don't have a DC power, have a look into the pre-made Point Of Load (POL) modules. Many of them support an ON/OFF control and with some luck, maybe some of them are able to be driven with a PWM signal. Then you can directly control the POL modulec) If you just want to drive some LEDs or such, most common LED drivers directly accept a PWM control input.Cheers,Dan

author: Balaur
author_rank: Unknown
timestamp: November 10, 2011, 10:39:57 pm
content: However, I forgot to add that it's quite improbable that a PWM method works on any device that has some kind of decoupling capacitors.

author: firewalker
author_rank: Super Contributor
timestamp: November 10, 2011, 11:14:38 pm
content: I know that a MOSFET is an exact match. 99.99% the device would contain a power MOSFET.I was intrigued by the nice packet with screw terminals. The device was referred as a pwm driver. Can't recall where it was. Perhaps a magazine advert.

author: NiHaoMike
author_rank: Super Contributor
timestamp: November 12, 2011, 04:09:58 am
content: You'll likely need a MOSFET driver in order to get low switching losses. That's especially true if you're using a low voltage processor and/or using high PWM frequencies.QuoteAdd an inductor. Then you get a buck converter.

author: IanJ
author_rank: Unknown
timestamp: January 25, 2012, 09:15:44 pm
content: Quote from: firewalker on November 10, 2011, 03:29:14 pmIf I'm reading you correctly.....http://www.dimensionengineering.com/Look at their Sabertooth DC motor controllers.I'm currently using one of their dual 60amp ones in a home made Segway.However, be careful when looking at these types of drivers as they all claim PWM input compatibility, but in actual fact they are analogue input and you need an external RC to convert PWM.In saying that, you do get true digital comms if you use their RC input mode (700uS to 1700uS).There are loads of others out there.Ian.
USB host with multiple downstream devices? - Page 1
Forum section: electronics / general

author: Nogginboink
author_rank: Newbie
timestamp: January 04, 2012, 03:39:16 pm
content: I'm looking for a microcontroller that can support multiple downstream devices. In particular, I'd need to support plugging both a USB mouse and a USB keyboard into my project. I'd prefer to be able to plug in a HID controller as well. (And heck, if I really want to get crazy maybe even a thumb drive, but that's way down the road.)I've only ever seen microcontrollers with a single USB host port, so to accomplish this I imagine I'd need a microcontroller, a USB hub chip, and sample code that supports a USB hub.Can anyone recommend a microcontroller to solve this problem?

author: NiHaoMike
author_rank: Super Contributor
timestamp: January 05, 2012, 07:39:06 pm
content: The mbed definitely supports hubs, but it only does USB 1.1 and is pretty expensive. For $25, you can soon get a Raspberry PI that has USB 2.0 and a 700MHz CPU.

author: gxti
author_rank: Frequent Contributor
timestamp: January 10, 2012, 03:09:18 am
content: As I understand it a USB host always requires a hub in order to have multiple downstream devices, even if that hub is built into the host chip. For example on my desktop "lsusb" shows two "root hubs", one for the USB 2.0 host and one for the USB 1.1 host (it's kind of old, heh). So while it's possible that some specialized microcontrollers might have a built-in hub or even multiple hosts it would be cheaper and more flexible to just have the one and let the designer choose a downstream part that meets their needs.
MPLAB X out of Beta (V1.00) - Page 1
Forum section: electronics / general

author: djsb
author_rank: Super Contributor
timestamp: December 27, 2011, 06:46:36 pm
content: According to post 8 in this topic on the MPLAB X forum.http://www.microchip.com/forums/m622018.aspxI have installed it on XP and Linux Mint 12. I'm going to start migrating my projects over to it when I've watched a video tutorial about doing just that.More later.David.

author: NiHaoMike
author_rank: Super Contributor
timestamp: December 28, 2011, 12:59:02 am
content: I had no problems migrating my projects out of beta. Just open them and select the latest compiler.

author: djsb
author_rank: Super Contributor
timestamp: December 28, 2011, 04:54:47 pm
content: I've just been importing all of my V8 projects into MPLABX V1.00 and everything has been going smoothly. It works well with the CCS compiler I'm using. Just got to try it with C30 next.David.

author: Hypernova
author_rank: Unknown
timestamp: December 29, 2011, 03:56:53 pm
content: Been using it at work since yesterday. Liked the features that an Eclipse based IDE brings but the new driver for the ICD3 seems a bit buggy as it often lose connection to it. Only way to fix it is to unplug and then replug in the ICD3. Programming also appears to take a few seconds longer.

author: ivan747
author_rank: Super Contributor
timestamp: December 31, 2011, 10:29:34 pm
content: Quote from: djsb on December 28, 2011, 04:54:47 pmThat's good to know. It didn't quite work when I last used MPLAB X about 3 months back.
WatchDog patting techniques. - Page 1
Forum section: electronics / general

author: firewalker
author_rank: Super Contributor
timestamp: December 15, 2011, 08:55:52 pm
content: Is it "bad" to pat the dog from a timer interrupt routine?Alexander.

author: Rudolfo
author_rank: Contributor
timestamp: December 15, 2011, 09:24:22 pm
content: Hello Alexander,the micro should receive an interrupt from an external independent watchdog (like a monoflop), if it can't restart the watchdog before the timeout is reached. Thus the micro must run a restart software routine triggered by an internal timer. Sometimes there is a second watchdog which resets the micro if the interrupt did not start the routine.Enjoy the day

author: Rufus
author_rank: Super Contributor
timestamp: December 15, 2011, 09:43:16 pm
content: Quote from: firewalker on December 15, 2011, 08:55:52 pmIf that is all you do then yes it is bad because the foreground code could hang without causing a watchdog time out.A simple solution is to maintain a counter in the timer interrupt which counts down to zero and re-trigger the watchdog only while the counter is non-zero. Foreground code can regularly set the count to some appropriate value. You can extend the idea with multiple counters which can ensure different sections of foreground code and even other interrupt handlers run regularly.

author: ejeffrey
author_rank: Super Contributor
timestamp: December 15, 2011, 10:46:13 pm
content: Unless your entire program runs from the interrupt routine putting the watchdog reset there is probably not very helpful.
Measuring Inductance with Charge Time Measurement Unit (CTMU) - Page 1
Forum section: electronics / general

author: gcp6ca
author_rank: Contributor
timestamp: December 08, 2011, 04:49:43 pm
content: I look at Microchips "AN1375, See What You Can Do with the CTMU":http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en553967It had a section called "Relative Inductance Measurement", so I am wondering it there is a way to measure the value of an inductor? I built an inductance meter using the comparator technique but it cannot measure proper values for inductors below 10uH and it was still flaky at higher values. Would the CTMU help me get a better readings at low values (0.1-10uH) or at higher values (10uH-10mH)?
Input and output config question - Page 1
Forum section: electronics / general

author: Spekkio
author_rank: Regular Contributor
timestamp: December 07, 2011, 11:16:35 am
content: I wonder, how does an MCU work internally when configuring a pin as input/output.From what I understand, when an I/O is configured as input it has a high resistance, and if configured as output it has low resistance.I have connected a SN65HVD231 Transceiver Rs pin to a I/O on a MCU, looking in the datasheet for the transceiver, you can read that the Rs pin controls the slope-control, putting a 100k resistor to ground from Rs pin will result in 2V/us slew rate, 10k sets it to 15V/us slew rate.If I connect a I/O to the Rs pin, and configure the I/O as an Input, would it be the same as connecting a large resistor to ground ?What happens when you configure the I/O as an output and set it to low-level, would it be the same as connecting the Rs pin directly to ground, and directly to Vcc when high-level?

author: Psi
author_rank: Super Contributor
timestamp: December 07, 2011, 11:53:48 am
content: Quote from: Spekkio on December 07, 2011, 11:16:35 amHard to say, if its set as an input it shouldn't be drawing any current at all, but it probably will a tiny bit.AVR datasheet says 1uA input leakage so @ 5v that's 5Meg Ohms, but it could be to high or low.Ya can't use this for anything, for all intensive purposes the input resistance is infinite.Unless you have a pin pullup enabled, then it will pull to vcc through the internal pullup (around ~50k)Quote from: Spekkio on December 07, 2011, 11:16:35 amCorrect.There will be a slight on-resistance in the micro's internal driver fets than means it wont be able to pull too exactly vcc or gnd, but it will get very close.Here's how the i/o pins works for AVRs.
ProtoStack ATmega328 Kit Review (Arduino Clone Build)  - Page 1
Forum section: electronics / general

author: EmbeddedEric
author_rank: Contributor
timestamp: November 26, 2011, 11:43:17 pm
content: I just completed a ProtoStack ATmega328 Kit Review and thought it might be helpful to anyone looking to step out outside the pre-built Arduino kits a little bit and create their own Arduino clone. I described the build and programming steps to turn this AVR kit into an Arduino clone:I managed to get my 7400 Logic PLL Based Switcher in the third place category of the Dangerous Prototypes Open 7400/4000 Series Logic Contest. Dangerous Prototypes had the neat idea to let the winners pick their own prizes from the many sponsor donated kits & parts; that way everyone gets something they want. I picked out one of the 3x ProtoStack ATmega328 Developments Kits they donated. I've been messing around with my Arduino Uno for a while and was looking to expand my Atmel AVR knowledge a bit and thought building up this kit and turning it into an Arduino clone would be a fun project. I figured I'd give a little review of the kit as I went along as well.For the rest of my review and detailed build and programming description go to my blog here:http://embeddederic.blogspot.com/2011/11/protoshack-atmega328-kit-review-arduino.html
Using PC RAM with microcontrollers - Page 1
Forum section: electronics / general

author: NiHaoMike
author_rank: Super Contributor
timestamp: November 06, 2011, 07:51:00 pm
content: Recently, I managed to get a bag of old RAM for free. It had a few 30 pin and 72 pin SIMMs, lots of SDRAM and DDR DIMMs, and even a few small DDR2 DIMMs. Since none of them are usable (or worth using) in a modern PC, is it possible to use them with high end microcontrollers like a PIC24/dsPIC or ARM M4?

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: November 06, 2011, 09:23:04 pm
content: Forget DDR2 or later as they tend to have PLL clocks that require a minimum clock rate.Standard SDRAM (unbuffered) can be interfaced fairly easily, either using onboard memory controllers on some of the higher end ARMs etc., or (slowly) via I/O ports.If you want good info on the protocols check the Micron website - their datasheets are very clear and comprehensive.SDRAM is also very easy to interface to FPGAs.

author: johnmx
author_rank: Frequent Contributor
timestamp: November 06, 2011, 09:26:26 pm
content: DRAM memories need a special controller to continuously refresh the memory cells. My guess is that this type of memory is not good for microcontrollers. SRAM type doesn’t have this problem.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: November 06, 2011, 10:34:04 pm
content: Quote from: johnmx on November 06, 2011, 09:26:26 pmIf you can access the RAM at reasonable speed, then refresh is a relatively easy task.

author: Psi
author_rank: Super Contributor
timestamp: November 07, 2011, 03:41:25 am
content: You won't be able to use external ram to extend the micros built in ram in order to have more variables etc. unless external ram is a special feature of that micro.But you can wire up the sram and write some code to read/write it yourself.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: November 07, 2011, 10:12:56 am
content: Quote from: Psi on November 07, 2011, 03:41:25 amThat's not necessarily true - some C compilers can support special variable types which are read and written via user-supplied routines, but can be accessed like normal variables.For example the IAR AVR compiler supports an __eeprom type qualifier that allows eeprom data to be used like any other variable.

author: sub
author_rank: Regular Contributor
timestamp: November 07, 2011, 11:10:07 am
content: Quote from: mikeselectricstuff on November 07, 2011, 10:12:56 amEven without magic compiler directives, if you're willing to use C++ you could probably accomplish the effect with operator overloading.