Go to advanced search

by sharpcoder
Mon Oct 24, 2016 3:32 am
Forum: General discussion
Topic: Stepper Motor is "over stepping"
Replies: 3
Views: 817

Re: Stepper Motor is "over stepping"

I figured it out, haha. It was due to a misunderstanding of how stepper motors work :P In my code, I call: step1(); step2(); step3(); step4(); and consider that one "step". I thought that just made a circuit around the motor and was, in fact, one step. But nah. Moving forward does require each one o...
by sharpcoder
Sun Oct 23, 2016 10:56 pm
Forum: General discussion
Topic: Stepper Motor is "over stepping"
Replies: 3
Views: 817

Re: Stepper Motor is "over stepping"

Sure thing. Here's the relevant code: https://gist.github.com/anonymous/8e8c5722e12f7a8b4d806d780e41f767 Here's a picture of the setup, though my prototype board is incredibly sloppy right now. It's probably not going to be very useful. I can do a more in-depth writeup of the wiring if that will hel...
by sharpcoder
Sun Oct 23, 2016 10:23 pm
Forum: General discussion
Topic: Stepper Motor is "over stepping"
Replies: 3
Views: 817

Stepper Motor is "over stepping"

Heyo, I have a NEMA17 stepper motor rated at 12v / 330mA @ 200 steps per revolution. It's hooked up to an L239D H-Bridge, powered by a 12v wall wart (at 600mA ). It was a struggle to get the motor spinning properly, but now thats over with, I'm realizing that it is "over stepping". IE: About 25 of m...
by sharpcoder
Wed Oct 12, 2016 6:06 pm
Forum: Other projects
Topic: Is there such a thing as hardware "design patterns"?
Replies: 10
Views: 2057

Re: Is there such a thing as hardware "design patterns"?

@W.H.Heydt Thanks for the in-depth information! I really appreciate it. You make some good points and now that I think about it, I'll probably need some way to make my motor achieve more accuracy than just 200 ticks per rotation (which is what it's rated for). I will think on this further. @Gavinmc4...
by sharpcoder
Wed Oct 12, 2016 3:48 am
Forum: Bare metal, Assembly language
Topic: STICKY: Bare Metal resources
Replies: 26
Views: 112115

Re: Bare Metal resources

complete c++ kernel for the raspberry pi: https://github.com/SharpCoder/rpi-kernel And the guide on how to compile it: https://rpidev.wordpress.com The kernel was developed with a raspberry A. Though it should work on newer ones (as far as I am aware). The code is mostly pretty well commented and do...
by sharpcoder
Wed Oct 12, 2016 3:34 am
Forum: Other projects
Topic: Is there such a thing as hardware "design patterns"?
Replies: 10
Views: 2057

Re: Is there such a thing as hardware "design patterns"?

@W. H. Heydt I've researched a few mounts. One promising one is called a dobsonian mount. But to make it controllable by the raspberry pi requires integrating a motor, and as far as I can tell, some parts of a dobsonian are traditionally friction based. Which is fine, that just means I'll have to im...
by sharpcoder
Wed Oct 12, 2016 3:15 am
Forum: Other projects
Topic: Is there such a thing as hardware "design patterns"?
Replies: 10
Views: 2057

Is there such a thing as hardware "design patterns"?

Hello! Thanks for taking a look at my post. Long story short, I'm trying to make an IoT telescope powered by the pi. Which sounds cool, and the software was super interesting to work on. But I am drowning in questions regarding the physical design of my project. I have a 12v Stepper motor (and succe...
by sharpcoder
Wed Apr 08, 2015 8:06 pm
Forum: Bare metal, Assembly language
Topic: Task Scheduling with Interrupts
Replies: 5
Views: 2523

Re: Task Scheduling with Interrupts

I think I've figured out most of my problems and implemented most of your suggestions, jwatte :) Here is what my methods look like now. vector.s ;@ And here is the actual interrupt handler code. arm_interrupt_handler: ;@ Store the registers stm sp, {r0,r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12} ;@ Move...
by sharpcoder
Tue Apr 07, 2015 6:26 pm
Forum: Bare metal, Assembly language
Topic: Task Scheduling with Interrupts
Replies: 5
Views: 2523

Re: Task Scheduling with Interrupts

jwatte, Thanks for the great response! You've helped me out immensely. After much tinkering, I have what appears to be a working implementation of multi-threading, however, a few problems arise... Which I suspect will be resolved once I implement the suggestions you've made :) First, is there anythi...
by sharpcoder
Tue Apr 07, 2015 12:32 am
Forum: Bare metal, Assembly language
Topic: Task Scheduling with Interrupts
Replies: 5
Views: 2523

Task Scheduling with Interrupts

Hello, I'm writing a hobby os from scratch (using c++) and I'm struggling with task scheduling. I already have interrupts working properly and wired up to the arm timer. For scheduling tasks in my os, the plan is to use the following thread class: class Thread { public: uint32_t lr; uint32_t runPtr;...
by sharpcoder
Wed Apr 03, 2013 4:39 pm
Forum: Bare metal, Assembly language
Topic: Interrupt Theory
Replies: 23
Views: 10150

Re: Interrupt Theory

Ah I see, thank you very much! That makes perfect sense :)
by sharpcoder
Wed Apr 03, 2013 3:50 pm
Forum: Bare metal, Assembly language
Topic: Interrupt Theory
Replies: 23
Views: 10150

Re: Interrupt Theory

Well, I finally got it! :D 20130402_231919.jpg Unfortunately, I don't 100% understand why it works. I spent days trying to get my own flavor of interrupt vector table initialization to work - but I think I was missing some key pieces. I've come away from this with some specific questions, so here go...
by sharpcoder
Fri Mar 29, 2013 11:57 pm
Forum: Bare metal, Assembly language
Topic: Question about the DMA
Replies: 13
Views: 3072

Re: Question about the DMA

Oh I didn't realize you were using 32-bit depth. My bad! I use 24-bit myself, but I'm sure you're right - it probably is 4 bytes when you get up to 32-bit depth.
by sharpcoder
Fri Mar 29, 2013 9:26 pm
Forum: Bare metal, Assembly language
Topic: Question about the DMA
Replies: 13
Views: 3072

Re: Question about the DMA

Try this... bl FlipScreen move r0, FrameBufferStructure.ScreenPointer ldr r1, [r0] move r2, 0xffffffff move r3, (SCREEN_HEIGHT * PITCH) str r2, [r1, r3] bl FlipScreen The reason I expect this to work is because the formula for drawing a pixel is as follows: uint offset = ( ( y + y_offset ) * pitch )...
by sharpcoder
Fri Mar 29, 2013 6:54 pm
Forum: Bare metal, Assembly language
Topic: How small is the smallest bare metal system with video?
Replies: 9
Views: 2956

Re: How small is the smallest bare metal system with video?

Rubbish. start.elf is about 2 megabytes, bootcode.bin is 20k or so and even a relatively heavy kernel.bin isn't gonna be that fat - a full Linux kernel is only around 3 megabytes. Yeah but I meant to format an IMG file as FAT32. Whenever I tried to do that, it failed unless the image was equal to o...
by sharpcoder
Fri Mar 29, 2013 4:58 pm
Forum: Bare metal, Assembly language
Topic: How small is the smallest bare metal system with video?
Replies: 9
Views: 2956

Re: How small is the smallest bare metal system with video?

The absolute smallest IMG you can produce is ~34mb (I think) due to the fact that the boot code must be FAT32. That being said, the actual code that you produce could be really small and still be powerful. I'm working on a bare metal project right now and my output image is approx: 34,816kb. So just...
by sharpcoder
Fri Mar 29, 2013 3:23 pm
Forum: Bare metal, Assembly language
Topic: Question about the DMA
Replies: 13
Views: 3072

Re: Question about the DMA

So if I'am reading the responce correctly, I have to reinit the screen with the physical screen dimension at 768. Actually, you need to re-init with the y offset at 768. Make sure to keep all of your original screen/virtual size variables the same as when you first initialized :) Also as rpdom sugg...
by sharpcoder
Fri Mar 29, 2013 3:10 pm
Forum: Bare metal, Assembly language
Topic: Interrupt Theory
Replies: 23
Views: 10150

Re: Interrupt Theory

blm768

Thank you! That makes so much more sense. I guess I assumed that the sections would be mapped to memory if I mapped them in the binary file properly, but in retrospect that seems silly... Now that I get what's happening, I'll give this another shot after work.
by sharpcoder
Fri Mar 29, 2013 4:33 am
Forum: Bare metal, Assembly language
Topic: Question about the DMA
Replies: 13
Views: 3072

Re: Question about the DMA

Hello Generav! Wouldn't it suck if the pixel was rendering, but that spot on your monitor was a dead pixel? :) I was able to get this working in C++, but that doesn't really apply to you since you're using assembly. I am still very new to assembly, so I doubt I'll be of much use... But let's see... ...
by sharpcoder
Fri Mar 29, 2013 4:10 am
Forum: Bare metal, Assembly language
Topic: Interrupt Theory
Replies: 23
Views: 10150

Re: Interrupt Theory

As always, I appreciate all of these responses! Unfortunately, I'm stuck on a generally related issue that is preventing me from even attempting to implement interrupts. I've spent more hours than I care to admit figuring out what's wrong, but I've finally narrowed it down - and it is, in fact, rela...
by sharpcoder
Thu Mar 28, 2013 5:58 pm
Forum: Bare metal, Assembly language
Topic: Question about the DMA
Replies: 13
Views: 3072

Re: Question about the DMA

One way to do it (that I have used), is to create a frame buffer twice the height of the display, update the second half off the buffer and then set the start Y offset to the height of the screen. This will act a bit like screen bank switching and display your updated screen instantly. Something li...
by sharpcoder
Thu Mar 28, 2013 3:54 pm
Forum: Bare metal, Assembly language
Topic: Question about the DMA
Replies: 13
Views: 3072

Question about the DMA

Hello everyone! While playing around with my framebuffer, I noticed if I try to create a cyclical hue renderer [basically color = 0x000000; while(true) color++; draw(color) ] I noticed that I get some ungodly vsync issues. What I mean by this is - you can clearly watch it redraw each line of color (...
by sharpcoder
Wed Mar 27, 2013 3:14 pm
Forum: Bare metal, Assembly language
Topic: Interrupt Theory
Replies: 23
Views: 10150

Re: Interrupt Theory

Can you show us the contents of 0024 onwards for a few words and also the address of your interrupt routine? Sure! Thought I don't know how much help it will be since it doesn't work right now :oops: Also the complete source for my project is available on my github repo. (Though it's in a weird sta...
by sharpcoder
Wed Mar 27, 2013 5:44 am
Forum: Bare metal, Assembly language
Topic: Interrupt Theory
Replies: 23
Views: 10150

Re: Interrupt Theory

Thanks to the responses here, some sample code, and reading through the ARM ARM - I've come up with something that I think should work! I have a few simple assembly questions though... Basically, what I've done is I created another file called irq.asm and in my linker.ld file I tell it the following...
by sharpcoder
Tue Mar 26, 2013 1:51 am
Forum: Bare metal, Assembly language
Topic: Interrupt Theory
Replies: 23
Views: 10150

Re: Interrupt Theory

@dwelch67 Thank you so much, I really appreciate this information! I am trying to learn, but without some of this assumed knowledge about low-level theory, it's very difficult. And no worries about rambling! I read it all and am very grateful to have access to so much relevant information. I'll be ...

Go to advanced search